Accept token in query string

This commit is contained in:
simon987 2019-03-24 12:41:58 -04:00
parent d9e8f6a53b
commit b3e4f8dd3c

View File

@ -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 {