public final class HeaderTransformsHelper extends Object
Modifier and Type | Method and Description |
---|---|
static Map<String,List<String>> |
canonicalizeSigningHeaders(Map<String,List<String>> headers) |
static String |
getCanonicalizedHeaderString(Map<String,List<String>> canonicalizedHeaders) |
static String |
trimAll(String value)
"The Trimall function removes excess white space before and after values,
and converts sequential spaces to a single space."
|
public static Map<String,List<String>> canonicalizeSigningHeaders(Map<String,List<String>> headers)
public static String trimAll(String value)
https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html
The collapse-whitespace logic is equivalent to:
value.replaceAll("\\s+", " ")but does not create a Pattern object that needs to compile the match string; it also prevents us from having to make a Matcher object as well.
Copyright © 2023. All rights reserved.