mirror of
https://github.com/simon987/ws_bucket.git
synced 2025-04-10 14:06:46 +00:00
Accept token in query string
This commit is contained in:
parent
d9e8f6a53b
commit
b3e4f8dd3c
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user