From afbb8abd8100a199d5b71b2f00c0d94da12228fe Mon Sep 17 00:00:00 2001 From: ZizzyDizzyMC Date: Sun, 21 Feb 2021 21:39:45 -0500 Subject: [PATCH] Update upload.go --- upload.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/upload.go b/upload.go index 26689a7..3321847 100644 --- a/upload.go +++ b/upload.go @@ -22,7 +22,7 @@ import ( "github.com/gabriel-vasile/mimetype" "github.com/zenazn/goji/web" ) - +const testHeader string = "test" var FileTooLargeError = errors.New("File too large.") var fileBlacklist = map[string]bool{ "favicon.ico": true, @@ -56,7 +56,7 @@ func uploadPostHandler(c web.C, w http.ResponseWriter, r *http.Request) { badRequestHandler(c, w, r, RespAUTO, "") return } - if r.Header.Get("Test-Header") == "test" { + if r.Header.Get("Test-Header") == testHeader { oopsHandler(c, w, r, RespHTML, "You killed it") } @@ -126,7 +126,7 @@ func uploadPostHandler(c web.C, w http.ResponseWriter, r *http.Request) { } func uploadPutHandler(c web.C, w http.ResponseWriter, r *http.Request) { - if len(r.Header.Get("Test-Header")) == "test" { + if len(r.Header.Get("Test-Header")) == testHeader { oopsHandler(c, w, r, RespHTML, "You killed it") } upReq := UploadRequest{}