Skip to content

Commit

Permalink
cross domain options
Browse files Browse the repository at this point in the history
  • Loading branch information
sjqzhang committed Aug 23, 2019
1 parent 0566ca2 commit 350d553
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fileserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -2141,7 +2141,11 @@ func (this *Server) Upload(w http.ResponseWriter, r *http.Request) {
output = r.FormValue("output")
if Config().EnableCrossOrigin {
this.CrossOrigin(w, r)
if r.Method == http.MethodOptions {
return
}
}

if Config().AuthUrl != "" {
if !this.CheckAuth(w, r) {
log.Warn("auth fail", r.Form)
Expand All @@ -2150,7 +2154,7 @@ func (this *Server) Upload(w http.ResponseWriter, r *http.Request) {
return
}
}
if r.Method == "POST" {
if r.Method == http.MethodPost {
md5sum = r.FormValue("md5")
output = r.FormValue("output")
if Config().ReadOnly {
Expand Down

0 comments on commit 350d553

Please sign in to comment.