Skip to content

Commit

Permalink
fix: cacheControl header when uploading
Browse files Browse the repository at this point in the history
  • Loading branch information
inian committed May 19, 2021
1 parent 31d6876 commit 090e0a1
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 090e0a1

Please sign in to comment.