getCanonicalRequest generate a canonical request of style. canonicalRequest = <HTTPMethod>\n <CanonicalURI>\n <CanonicalQueryString>\n <CanonicalHeaders>\n <SignedHeaders>\n <HashedPayload>
(req http.Request, ignoredHeaders map[string]bool, hashedPayload string)
| 185 | // <SignedHeaders>\n |
| 186 | // <HashedPayload> |
| 187 | func getCanonicalRequest(req http.Request, ignoredHeaders map[string]bool, hashedPayload string) string { |
| 188 | req.URL.RawQuery = strings.ReplaceAll(req.URL.Query().Encode(), "+", "%20") |
| 189 | canonicalRequest := strings.Join([]string{ |
| 190 | req.Method, |
| 191 | s3utils.EncodePath(req.URL.Path), |
| 192 | req.URL.RawQuery, |
| 193 | getCanonicalHeaders(req, ignoredHeaders), |
| 194 | getSignedHeaders(req, ignoredHeaders), |
| 195 | hashedPayload, |
| 196 | }, "\n") |
| 197 | return canonicalRequest |
| 198 | } |
| 199 | |
| 200 | // getStringToSign a string based on selected query values. |
| 201 | func getStringToSignV4(t time.Time, location, canonicalRequest, serviceType string) string { |
no test coverage detected