From cc5587319b411fc6896f18c8d174d6034f4ee5e5 Mon Sep 17 00:00:00 2001 From: Julian Hurst Date: Thu, 23 Jan 2025 12:12:59 +0100 Subject: Make upload endpoint static --- main.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index 949d2f3..3e2cd86 100644 --- a/main.go +++ b/main.go @@ -69,6 +69,10 @@ func (handler BoxHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } w.WriteHeader(http.StatusNoContent) case http.MethodPost: + if r.URL.Path != "/upload" { + w.WriteHeader(http.StatusBadRequest) + return + } token := r.Header.Get("X-Upload-Token") if token != handler.token { log.Println("unauthorized") -- cgit v1.2.3