Skip to content

Commit

Permalink
Merge pull request #8 from supabase/fix/cache-control
Browse files Browse the repository at this point in the history
fix: cacheControl header when uploading
  • Loading branch information
inian committed May 19, 2021
2 parents 31d6876 + 090e0a1 commit 834de2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/StorageFileApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ export class StorageFileApi {
if (!isBrowser()) throw new Error('No browser detected.')

const formData = new FormData()
formData.append('', file, file.name)

const options = { ...DEFAULT_FILE_OPTIONS, ...fileOptions }
formData.append('cacheControl', options.cacheControl)
formData.append('', file, file.name)

const _path = this._getFinalPath(path)
const res = await fetch(`${this.url}/object/${_path}`, {
Expand Down Expand Up @@ -83,10 +83,10 @@ export class StorageFileApi {
if (!isBrowser()) throw new Error('No browser detected.')

const formData = new FormData()
formData.append('', file, file.name)

const options = { ...DEFAULT_FILE_OPTIONS, ...fileOptions }
formData.append('cacheControl', options.cacheControl)
formData.append('', file, file.name)

const _path = this._getFinalPath(path)
const res = await fetch(`${this.url}/object/${_path}`, {
Expand Down

0 comments on commit 834de2a

Please sign in to comment.