@@ -34,6 +34,10 @@ You can get signed URL for other S3 operations too, like `PutObjectCommand`.
3434` expiresIn ` config from the examples above is optional. If not set, it's default
3535at ` 900 ` .
3636
37+ If your request contains server-side encryption(` SSE* ` ) configurations, because
38+ of S3 limitation, you need to send corresponding headers along with the
39+ presigned url. For more information, please go to [ S3 SSE reference] ( https://docs.aws.amazon.com/AmazonS3/latest/dev/KMSUsingRESTAPI.html )
40+
3741If you already have a request, you can pre-sign the request following the
3842section bellow.
3943
@@ -51,7 +55,7 @@ const signer = new S3RequestPresigner({
5155 sha256: Hash .bind (null , " sha256" ), // In Node.js
5256 // sha256: Sha256 // In browsers
5357});
54- const url = await signer .presign (request);
58+ const presigned = await signer .presign (request);
5559```
5660
5761ES6 Example:
@@ -66,7 +70,7 @@ const signer = new S3RequestPresigner({
6670 sha256: Hash .bind (null , " sha256" ), // In Node.js
6771 // sha256: Sha256 // In browsers
6872});
69- const url = await signer .presign (request);
73+ const presigned = await signer .presign (request);
7074```
7175
7276To avoid redundant construction parameters when instantiating the s3 presigner,
@@ -79,3 +83,12 @@ const signer = new S3RequestPresigner({
7983 ... s3 .config ,
8084});
8185```
86+
87+ If your request contains server-side encryption(` x-amz-server-side-encryption* ` )
88+ headers, because of S3 limitation, you need to send these headers along
89+ with the presigned url. That is to say, the url only from calling ` formatUrl() `
90+ to ` presigned ` is not sufficient to make a request. You need to send the
91+ server-side encryption headers along with the url. These headers remain in the
92+ ` presigned.headers `
93+
94+ For more information, please go to [ S3 SSE reference] ( https://docs.aws.amazon.com/AmazonS3/latest/dev/KMSUsingRESTAPI.html )
0 commit comments