Skip to content

Commit 01d3a11

Browse files
authored
Clarify what makes URL browser incompatible (#3019)
1 parent b9c753e commit 01d3a11

File tree

1 file changed

+21
-4
lines changed
  • services/s3/src/main/java/software/amazon/awssdk/services/s3/presigner

1 file changed

+21
-4
lines changed

services/s3/src/main/java/software/amazon/awssdk/services/s3/presigner/S3Presigner.java

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
* requiring access to Alice's credentials.
6262
* <p/>
6363
*
64-
* <b>Signature Duration</b>
64+
* <h2>Signature Duration</h2>
6565
* <p/>
6666
*
6767
* Pre-signed requests are only valid for a finite period of time, referred to as the signature duration. This signature
@@ -70,7 +70,7 @@
7070
* duration has passed will result in an access denied response from the service.
7171
* <p/>
7272
*
73-
* <b>Example Usage</b>
73+
* <h3>Example Usage</h3>
7474
* <p/>
7575
*
7676
* <pre>
@@ -109,7 +109,7 @@
109109
* </pre>
110110
* <p/>
111111
*
112-
* <b>Browser Compatibility</b>
112+
* <h2>Browser Compatibility</h2>
113113
* <p/>
114114
*
115115
* Some pre-signed requests can be executed by a web browser. These "browser compatible" pre-signed requests
@@ -123,7 +123,24 @@
123123
* being browser-compatible.
124124
* <p />
125125
*
126-
* <b>Executing a Pre-Signed Request from Java code</b>
126+
* <h3>Configurations that affect browser compatibility</h3>
127+
* <h4>Enabling Checking Validation</h4>
128+
* If checksum validations are enabled, the presigned URL will no longer be browser compatible because it adds a signed header
129+
* that must be included in the HTTP request.
130+
*
131+
* Checksum validation is disabled in the presigner by default, but when using a custom {@link S3Configuration} when enabling
132+
* features like path style access or accelerate mode, it must be explicitly disabled:
133+
*
134+
* <pre>
135+
* S3Presigner presigner = S3Presigner.builder()
136+
* .serviceConfiguration(S3Configuration.builder()
137+
* .checksumValidationEnabled(false)
138+
* .build())
139+
* .build();
140+
* </pre>
141+
*
142+
*
143+
* <h2>Executing a Pre-Signed Request from Java code</h2>
127144
* <p />
128145
*
129146
* Browser-compatible requests (see above) can be executed using a web browser. All pre-signed requests can be executed

0 commit comments

Comments
 (0)