filer: add CORS support

This commit is contained in:
Chris Lu
2020-10-31 16:44:03 -07:00
parent 05acc33294
commit 306062b4e7
3 changed files with 29 additions and 9 deletions

View File

@@ -270,10 +270,3 @@ func writeResponseContent(filename, mimeType string, rs io.ReadSeeker, w http.Re
})
return nil
}
func (vs *VolumeServer) OptionsHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Add("Access-Control-Allow-Origin", "*")
w.Header().Add("Access-Control-Allow-Methods", "PUT, POST, GET, DELETE, OPTIONS")
w.Header().Add("Access-Control-Allow-Headers", "Content-Type")
w.Header().Add("Access-Control-Allow-Credentials", "true")
}