Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.

downloadFile and uploadFile ignore headers object #79

Closed
1 of 2 tasks
ynunez opened this issue Jan 21, 2021 · 1 comment
Closed
1 of 2 tasks

downloadFile and uploadFile ignore headers object #79

ynunez opened this issue Jan 21, 2021 · 1 comment
Milestone

Comments

@ynunez
Copy link

ynunez commented Jan 21, 2021

Describe the bug

When downloading or uploading a file from a protected resource and sending an authorization header (or any other headers) the native iOS code doesn't use the headers to build the request.

Environments

  • Android
  • iOS

To Reproduce

const options: any = {
      url: https://your-host/proteced-download,
      name: 'file',
      filePath: filePath,
      headers: {
        Authorization: `Bearer ${accessToken}`
      }
 };

Http.uploadFile(options)

Expected behavior

Both HttpDownloadFileOptions and HttpDownloadFileOptions extend HttpDownloadFileOptions which has the headers object as an optional parameter. The download/upload functions should accept the headers object like it does on Android.

ynunez added a commit to ynunez/http that referenced this issue Jan 21, 2021
ynunez added a commit to ynunez/http that referenced this issue Jan 21, 2021
fix for capacitor-community#79 downloadFile and uploadFile ignore headers object
@thomasvidas thomasvidas added this to the 1.0.0 milestone Feb 3, 2021
@thomasvidas
Copy link
Contributor

Fixed already in capacitor-v3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants