-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Handle unexpected behavior with URI#merge and subpaths missing trailing slashes #3123
Handle unexpected behavior with URI#merge and subpaths missing trailing slashes #3123
Conversation
Thanks for opening a pull request and helping make RubyGems better! Someone from the RubyGems team will take a look at your pull request shortly and leave any feedback. Please make sure that your pull request has tests for any changes or added functionality. We use Github Actions to test and make sure your change works functionally and uses acceptable conventions, you can review the current progress of Github Actions in the PR status window below. If you have any questions or concerns that you wish to ask, feel free to leave a comment in this PR or join our #rubygems channel on Slack. For more information about contributing to the RubyGems project feel free to review our CONTRIBUTING guide |
41f31f7
to
02dc250
Compare
Hey @drcapulet! could you add the test into |
@bronzdoc Was there something you'd want me to cover in |
@drcapulet sorry for the confusion. I meant "move" not "add" |
@drcapulet Hi, Can you move the your test into the After that, I will merge this. |
@hsbt As I mentioned earlier, I wasn't sure of a good way to set |
@hsbt Should @drcapulet copy the test setup across each of the tests or do you have another preferred way? In my opinion, a separate test file like it is coded currently is fine. By the way, does this fix or is related to #1829? |
@deivid-rodriguez Yes, this should fix #1829. |
Great! Could you rebase this PR to make sure everything is still good, and so that the PR is ready to merge in case @hsbt is fine with it now? |
625c8cc
to
9ec4728
Compare
9ec4728
to
36fa541
Compare
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.
I rebased this PR and added my suggestions. I'll merge in a couple of days unless there's further feedback.
Thanks @drcapulet! |
Handle unexpected behavior with URI#merge and subpaths missing trailing slashes (cherry picked from commit 6d7fe84)
Handle unexpected behavior with URI#merge and subpaths missing trailing slashes (cherry picked from commit 6d7fe84)
Due to how
URI#merge
works (whichURI#+
is aliased to), when using a source under a subpath, it can get overwritten:It's not immediately obvious that errors fetching would be caused by a missing slash, especially if you have a server mounted at both
/
and/private
.This PR makes sure that calls to
URI#+
are more obvious and subpaths aren't overwritten and instead appended.Fixes #1829.