fix: pass bucket as query arg, not as form data

This commit is contained in:
Derrick Hammer 2024-01-20 22:51:00 -05:00
parent 6bee380e75
commit c2cccc4b84
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 6 deletions

View File

@ -74,9 +74,7 @@ func (s StorageServiceImpl) PutFileSmall(file io.ReadSeeker, bucket string, gene
resp, err := s.httpApi.R().
SetPathParam("path", hashStr).
SetFormData(map[string]string{
"bucket": bucket,
}).
SetQueryParam("bucket", bucket).
SetBody(file).Put("/api/worker/objects/{path}")
if err != nil {
return nil, err
@ -102,9 +100,7 @@ func (s StorageServiceImpl) PutFile(file io.Reader, bucket string, hash []byte)
resp, err := s.httpApi.R().
SetPathParam("path", hashStr).
SetFormData(map[string]string{
"bucket": bucket,
}).
SetQueryParam("bucket", bucket).
SetBody(file).Put("/api/worker/objects/{path}")
if err != nil {
return err