api: Always strip 80/443 port from host#709
Merged
Merged
Conversation
harshavardhana
previously approved these changes
Jun 14, 2017
Member
harshavardhana
left a comment
There was a problem hiding this comment.
Must need. Thanks @vadmeste
krisis
reviewed
Jun 16, 2017
Member
krisis
left a comment
There was a problem hiding this comment.
LGTM. Does it make sense to write a unit test for makeTargetURL?
Member
👍 |
Member
Author
Tests for makeTargetURL are added. |
krisis
reviewed
Jun 16, 2017
| {"localhost:9000", false, "mybucket", "myobject", "", nil, url.URL{Host: "localhost:9000", Scheme: "http", Path: "/mybucket/myobject"}, nil}, | ||
| // Test 7 | ||
| {"localhost:9000", false, "mybucket", "myobject", "", map[string][]string{"param": []string{"val"}}, url.URL{Host: "localhost:9000", Scheme: "http", Path: "/mybucket/myobject", RawQuery: "param=val"}, nil}, | ||
| } |
Member
There was a problem hiding this comment.
Could you add a test case each with address https://localhost:443 and http://localhost:80?
Member
Author
There was a problem hiding this comment.
Could you add a test case each with address https://localhost:443 and http://localhost:80?
oups, yes
Member
Author
There was a problem hiding this comment.
Could you add a test case each with address https://localhost:443 and http://localhost:80?
Done @krisis
HTTP clients like browsers or curl automatically strip port 80 and 443 in Host header. This PR makes minio-go follow the same behavior so the generated presigned urls can work without having signature mismatch error.
harshavardhana
approved these changes
Jun 16, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HTTP clients like browsers or curl automatically strip port 80 and 443
in Host header. This PR makes minio-go follow the same behavior
so the generated presigned urls can work without having signature
mismatch error.
Fixes #695