File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
api/src/main/java/io/minio Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -134,12 +134,14 @@ private void setCanonicalHeaders(Set<String> ignored_headers) {
134134 // https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html
135135 // * Header having multiple values should be converted to comma separated values.
136136 // * Multi-spaced value of header should be trimmed to single spaced value.
137+ // * Trim leading/trailing spaces in header value (As OkHttp trims leading/trailing spaces
138+ // automatically, this is added for completion).
137139 this .canonicalHeaders .put (
138140 signedHeader ,
139141 headers .values (name ).stream ()
140142 .map (
141143 value -> {
142- return value .replaceAll ("( +)" , " " );
144+ return value .replaceAll ("( +)" , " " ). trim () ;
143145 })
144146 .collect (Collectors .joining ("," )));
145147 }
You can’t perform that action at this time.
0 commit comments