Skip to content

Commit 934fa8e

Browse files
authored
fix: metadata ordering on multipart form/data (#211)
1 parent 716d679 commit 934fa8e

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
"types-generate": "dts-gen -m '@supabase/storage-js' -s",
3131
"test": "run-s test:clean test:infra test:suite test:clean",
3232
"test:suite": "jest --runInBand",
33-
"test:infra": "cd infra && docker-compose down && docker-compose up -d --build && sleep 10",
34-
"test:clean": "cd infra && docker-compose down --remove-orphans",
33+
"test:infra": "cd infra && docker compose down && docker compose up -d --build && sleep 10",
34+
"test:clean": "cd infra && docker compose down --remove-orphans",
3535
"docs": "typedoc --entryPoints src/index.ts --out docs/v2 --entryPoints src/packages/* --excludePrivate --excludeProtected",
3636
"docs:json": "typedoc --json docs/v2/spec.json --entryPoints src/index.ts --entryPoints src/packages/* --excludePrivate --excludeExternals --excludeProtected"
3737
},

src/packages/StorageFileApi.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,10 @@ export default class StorageFileApi {
9292
if (typeof Blob !== 'undefined' && fileBody instanceof Blob) {
9393
body = new FormData()
9494
body.append('cacheControl', options.cacheControl as string)
95-
body.append('', fileBody)
96-
9795
if (metadata) {
9896
body.append('metadata', this.encodeMetadata(metadata))
9997
}
98+
body.append('', fileBody)
10099
} else if (typeof FormData !== 'undefined' && fileBody instanceof FormData) {
101100
body = fileBody
102101
body.append('cacheControl', options.cacheControl as string)

0 commit comments

Comments
 (0)