chore: add 'Access-Control-Allow-Origin' header to put response

This commit is contained in:
2022-03-21 09:09:28 +01:00
parent 2e5a0d6b6a
commit f3d2ee8e3a
+1
View File
@@ -73,6 +73,7 @@ func (s *Server) upload(path string, w http.ResponseWriter, req *http.Request) {
return
}
w.Header().Add("Access-Control-Expose-Headers", "X-File-URL")
w.Header().Add("Access-Control-Allow-Origin", "*")
fileUrl := filepath.Join(s.returnUrl, path)
w.Header().Add("X-File-URL", fileUrl)
s.logger.Infof("success - file is available at %s", fileUrl)