Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change android request builder so it wont set Content-Type header to … #126

Merged
merged 1 commit into from
Aug 6, 2018

Conversation

LorienHW
Copy link

@LorienHW LorienHW commented Jul 20, 2018

…application/octet-stream if it was explicitly set to the empty string. This fixes amazon s3 uploads with a presigned url

This was fixed in a branch in the original project:
wkh237@3b58491

And submitted as an issue and tracked in wkh237#425

Its required for amazon s3 uploads using a secure upload url, which require the Content-Type header to be set to nothing. It will be called in the JS like so:

export function uploadFileToS3(presignedUrl, image) {
  const body = RNFetchBlob.wrap(image.uri.replace('file://', ''));
  return RNFetchBlob.fetch('PUT', presignedUrl,
    {
      'Content-Type': '',
    },
    body
  )
}

…application/octet-stream if it was explicitly set to the empty string. This fixes amazon s3 uploads with a presigned url
@Traviskn
Copy link

Traviskn commented Aug 6, 2018

Thanks for your PR and explanation of the issue

@Traviskn Traviskn merged commit 981627e into joltup:master Aug 6, 2018
cguino pushed a commit to BeApp/rn-fetch-blob that referenced this pull request Jul 5, 2023
* Transform for read and write methods (e.g. for encryption)

fixes joltup#92
fixes joltup#126
fixes joltup#131
fixes joltup#120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants