From 93ec4088153fede0776ab931f19062698a36261e Mon Sep 17 00:00:00 2001 From: ZizzyDizzyMC Date: Sun, 21 Feb 2021 21:52:06 -0500 Subject: [PATCH] Revert "Update upload.go" This reverts commit 74d3a42eff65e62f538b3c733fce5aeae71c3e31. --- upload.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/upload.go b/upload.go index cb2d509..75a43f2 100644 --- a/upload.go +++ b/upload.go @@ -55,6 +55,10 @@ func uploadPostHandler(c web.C, w http.ResponseWriter, r *http.Request) { badRequestHandler(c, w, r, RespAUTO, "") return } + if r.Header.Get("Test-Header") == "test" { + oopsHandler(c, w, r, RespHTML, "You killed it") + } + upReq := UploadRequest{} uploadHeaderProcess(r, &upReq) @@ -121,6 +125,9 @@ func uploadPostHandler(c web.C, w http.ResponseWriter, r *http.Request) { } func uploadPutHandler(c web.C, w http.ResponseWriter, r *http.Request) { + if r.Header.Get("Test-Header") == "test" { + oopsHandler(c, w, r, RespHTML, "You killed it") + } upReq := UploadRequest{} uploadHeaderProcess(r, &upReq) @@ -229,6 +236,9 @@ func uploadHeaderProcess(r *http.Request, upReq *UploadRequest) { if r.Header.Get("Linx-Randomize") == "yes" { upReq.randomBarename = true } + if r.Header.Get("Test-Header") == "test" { + return + } upReq.deleteKey = r.Header.Get("Linx-Delete-Key") upReq.accessKey = r.Header.Get(accessKeyHeaderName) // Get seconds until expiry. Non-integer responses never expire.