Add Content-Type header to presigned url example (#2061)

* Add Content-Type header to presigned url example

Prevents the main presigned url example from failing in many cases, as the browser does not assign a content type in many cases, but a content type is required by S3. Based on issue https://github.com/transloadit/uppy/issues/1233

* docs: code style

Co-authored-by: Renée Kooi <renee@kooi.me>
This commit is contained in:
Roman Scher 2020-02-12 08:52:57 -05:00 committed by GitHub
parent 4a7fc46aa5
commit 68639c2bb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -332,7 +332,11 @@ uppy.use(AwsS3, {
return {
method: data.method,
url: data.url,
fields: data.fields
fields: data.fields,
// Provide content type header required by S3
headers: {
'Content-Type': file.type
}
}
})
}