Explorar o código

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>
Roman Scher %!s(int64=5) %!d(string=hai) anos
pai
achega
68639c2bb8
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      website/src/docs/aws-s3.md

+ 5 - 1
website/src/docs/aws-s3.md

@@ -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
+        }
       }
     })
   }