-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
properly handle URLs that already contain a query string #223
Conversation
This is a little more complex than I initially thought. Parameters should not be overwritten since a query string can contain a key multiple times. EDIT: added a commit that fixes this |
Thanks for the PR. I will have look soon. Sorry for the delay to give feedback |
No worries, thanks for considering it! |
else | ||
url | ||
end | ||
cond do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So there are now 3 cases here. I suspect we should have now 3 tests (1 for each case) right? How can we reach the true
case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the true
case is reached in the get with params
test. The second condition is reached in the test I added and the first condition is reached in the get
test. Maybe cond do
isn't the best choice here, do you want me to change it into a nested if else
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha! Thanks for the explanation. Hmm I think cond is fine!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're welcome!
Thanks! I'm sorry for the delay 😶 |
before this, URLs that already contain a query string were not handled.
note that the URL used was
https://httpbin.org/get?yolo=bolo%3Fwhut=hello
nothttps://httpbin.org/get?yolo=bolo&whut=hello