[aws-s3] Uploading with put throws an error (due to missing Content-Type header in response)
See original GitHub issueHi!
As mentioned in the title: the PUT response from aws will return no “Content-Type” header. The following example shows the headers return by a simple PUT request to S3.
HTTP/1.1 200 OK
x-amz-id-2: q4jaFwYFbwWjQZzI3jHoGygUWOdGwaMPfTVAPnTVvseJQ7KjWfRylI/ho0aIlP6V7CctJQrkbq8=
x-amz-request-id: 09DC93B9A15AD167
Date: Sun, 29 Dec 2019 11:14:59 GMT
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: PUT, POST, DELETE
Vary: Origin, Access-Control-Request-Headers, Access-Control-Request-Method
ETag: "8346e97a75f3c6278c9e6a46f5374c1b"
Content-Length: 0
Server: AmazonS3
This response leads to the following error:
Uncaught TypeError: Cannot read property 'replace' of null
at isXml (index.js:32)
at Object.getResponseData (index.js:246)
at XMLHttpRequest.<anonymous> (index.js:291)
In the isXml() function it is expected that the header is set.
Does it make sense to just return false in case the Content-Type is not set?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Error Responses - Amazon Simple Storage Service
Error Code Description HTTP Status Code
AccessControlListNotSupported The bucket does not allow ACLs. 400 Bad Request
AccessDenied Access Denied 403 Forbidden
BucketAlreadyOwnedByYou 409 Conflict (in all...
Read more >Resolve errors uploading data to or downloading data ... - AWS
I want to download data from Amazon Aurora and upload it to Amazon S3. How can I resolve an error I received while...
Read more >Troubleshooting CORS - Amazon Simple Storage Service
If the header is missing, Amazon S3 doesn't treat the request as a cross-origin request, and doesn't send CORS response headers in the...
Read more >Uploading objects - Amazon Simple Storage Service
When you upload a file to Amazon S3, it is stored as an S3 object. Objects consist of the file data and metadata...
Read more >CompleteMultipartUpload - Amazon Simple Storage Service
Completes a multipart upload by assembling previously uploaded parts. You first initiate the multipart upload and then upload all parts using the UploadPart ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Great that this issue has been fixed! Do we know when it will be in the latest release on npm?
Facing the same issue.