Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Do not remove trailing slashes, when dealing with relative urls. #71

Closed
wants to merge 5 commits into from

Conversation

badazz91
Copy link

@badazz91 badazz91 commented Mar 8, 2016

see #70

@badazz91 badazz91 changed the title Do not remove trailing slashes, when dealing with relative urls. ixes #70 Do not remove trailing slashes, when dealing with relative urls. Fixes #70 Mar 8, 2016
@badazz91 badazz91 changed the title Do not remove trailing slashes, when dealing with relative urls. Fixes #70 Do not remove trailing slashes, when dealing with relative urls. Mar 8, 2016
@alexlafroscia
Copy link
Collaborator

@badazz91 can you add me as a collaborator on your fork? I added a failing test that is introduced by your changes.

It is implemented the way it is right now, always ensuring a / at the beginning and no / at the end, is so that the method can be used to sanitize any of the URL segments that might be passed in from the namespace or host option on the service or from the request options hash. By not removing the / at the end, we break the fact that sometimes that behavior is depended on, so the change to fix #70 will have to leave this method the way it was originally.

@badazz91
Copy link
Author

badazz91 commented Mar 9, 2016

@alexlafroscia I added you as a collaborator.

@alexlafroscia
Copy link
Collaborator

@badazz91 great, thanks. I added the commit with the failing test.

fpauser and others added 2 commits March 9, 2016 16:24
@badazz91
Copy link
Author

@alexlafroscia We made some modifications, to satisfy the failing test. Let me know about your thoughts.

@alexlafroscia
Copy link
Collaborator

I added some more test cases, found a place where they fail again. I still feel pretty strongly that _normalizePath should be left as it was, to ensure that all the segments end up in the same format (/ at the start, no / at the end). Maybe checking if the full URL has a trailing slash, and then add it back at the end if it needs it?

@alexlafroscia
Copy link
Collaborator

Closed in favor of #96 which was merged a while back.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants