Fix ts_config_http:parse_URL/4 to deal with empty paths#307
Merged
Conversation
Collaborator
Author
|
If you could have a quick look @nniclausse, this would be really nice. The change is rather simple and I currently don't see any potential issues arising from this, but maybe you can have a quick look nonetheless? |
nniclausse
approved these changes
Jun 18, 2018
Contributor
nniclausse
left a comment
There was a problem hiding this comment.
test case was missing; added. looks good for me !
Collaborator
Author
|
duh, still need to get more familiar with testing in Erlang/tsung. Thanks @nniclausse! |
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.
This is a fix to address #227
For URLs with an empty path, like
http://example.com?foo=bar, we used to see this when using a dynamic URL for making a HTTP request (as reported by @adrian7):It turns out
ts_config_http:parse_URL/4does not stop at?when trying to identify the host in a given absolute URL.With this PR,
ts_config_http:parse_URL/4now properly detects that the host part has been finished (because we encounter the?) and produces an empty path instead. We have to setURL#url{path="/"};because otherwise we will produce an invalid HTTP request like:GET ?foo=bar HTTP/1.1