mirror of
https://github.com/simon987/ws_bucket.git
synced 2025-12-14 07:09:07 +00:00
Allow passing the upload token as query string for reading
This commit is contained in:
@@ -142,6 +142,9 @@ func (api *WebApi) Upload(ctx *fasthttp.RequestCtx) {
|
||||
func (api *WebApi) ReadUploadSlot(ctx *fasthttp.RequestCtx) {
|
||||
|
||||
tokenStr := string(ctx.Request.Header.Peek("X-Upload-Token"))
|
||||
if tokenStr == "" {
|
||||
tokenStr = string(ctx.Request.URI().QueryArgs().Peek("token"))
|
||||
}
|
||||
|
||||
slot := UploadSlot{}
|
||||
err := api.db.Where("token=?", tokenStr).First(&slot).Error
|
||||
|
||||
Reference in New Issue
Block a user