From 362641a436c1cd38605c23919855b9957b462206 Mon Sep 17 00:00:00 2001 From: minoplhy Date: Mon, 15 Apr 2024 01:00:25 +0700 Subject: [PATCH] add: set Response Content-Type --- main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.go b/main.go index d7e3673..d672c09 100644 --- a/main.go +++ b/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")