summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJulian Hurst <julian.hurst@digdash.com>2025-01-23 12:12:59 +0100
committerJulian Hurst <julian.hurst@digdash.com>2025-01-23 12:12:59 +0100
commitcc5587319b411fc6896f18c8d174d6034f4ee5e5 (patch)
tree0ef4c194c6f12e615aaf0b1f38a22d53c83cb881 /main.go
parentfccb6c6a78aaa197ad21a81df49a33882b942cbf (diff)
downloadbox-cc5587319b411fc6896f18c8d174d6034f4ee5e5.tar.gz
Make upload endpoint static
Diffstat (limited to 'main.go')
-rw-r--r--main.go4
1 files changed, 4 insertions, 0 deletions
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")