Skip to content

Commit dd7090f

Browse files
authored
Fix NPE thrown from signer when a header value is null (#5659)
1 parent e4e291b commit dd7090f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/internal/signer/V4CanonicalRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,10 @@ private static String getCanonicalRequestString(String httpMethod, String canoni
249249
* Matcher object as well.
250250
*/
251251
private static void addAndTrim(StringBuilder result, String value) {
252-
int valueLength = value.length();
253-
if (valueLength == 0) {
252+
if (StringUtils.isEmpty(value)) {
254253
return;
255254
}
255+
int valueLength = value.length();
256256

257257
int start = 0;
258258
// Find first non-whitespace

0 commit comments

Comments
 (0)