add: set Response Content-Type
This commit is contained in:
parent
c4cc672c52
commit
362641a436
3
main.go
3
main.go
@ -25,6 +25,9 @@ func uploadHandler(w http.ResponseWriter, r *http.Request) {
|
||||
maxUploadSize = 10 * 1024 * 1024 // 10 MB
|
||||
}
|
||||
|
||||
// Set Response Content-Type
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
||||
if r.Method != "POST" {
|
||||
http.Error(w, handler.ErrorResponseBuild(http.StatusMethodNotAllowed, "Method not allowed"), http.StatusMethodNotAllowed)
|
||||
handler.ErrorLogBuilder([]string{r.RemoteAddr}, "Method not allowed")
|
||||
|
Loading…
Reference in New Issue
Block a user