mirror of
https://github.com/minio/minio.git
synced 2025-11-20 09:56:07 -05:00
tests: Move signature calculation in separate function. (#2160)
Previously newTestRequest() creates request object and returns signature v4 signed request. In TestCopyObject(), its required to add headers later to the request and sign the request. This patch introduces two new functions * signRequest(): signs request using given access/secret keys. * newTestSignedRequest(): returns new request object signed with given access/secret keys. Fixes #2097
This commit is contained in:
@@ -99,8 +99,6 @@ func getSignedHeaders(signedHeaders http.Header) string {
|
||||
func getCanonicalRequest(extractedSignedHeaders http.Header, payload, queryStr, urlPath, method, host string) string {
|
||||
rawQuery := strings.Replace(queryStr, "+", "%20", -1)
|
||||
encodedPath := getURLEncodedName(urlPath)
|
||||
// Convert any space strings back to "+".
|
||||
encodedPath = strings.Replace(encodedPath, "+", "%20", -1)
|
||||
canonicalRequest := strings.Join([]string{
|
||||
method,
|
||||
encodedPath,
|
||||
|
||||
Reference in New Issue
Block a user