From b3e4f8dd3ca9604379db2764739ff2987961a424 Mon Sep 17 00:00:00 2001 From: simon987 Date: Sun, 24 Mar 2019 12:41:58 -0400 Subject: [PATCH] Accept token in query string --- api/slot.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/slot.go b/api/slot.go index 4e0379e..c7e5859 100644 --- a/api/slot.go +++ b/api/slot.go @@ -72,6 +72,11 @@ func (api *WebApi) AllocateUploadSlot(ctx *fasthttp.RequestCtx) { func (api *WebApi) Upload(ctx *fasthttp.RequestCtx) { token := string(ctx.Request.Header.Peek("X-Upload-Token")) + + if token == "" { + token = string(ctx.Request.URI().QueryArgs().Peek("token")) + } + slot := UploadSlot{} err := api.db.Where("token=?", token).First(&slot).Error if err != nil {