Skip to content
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

Incorrectly removing trailing slash from URL #12

Open
sb-relaxt-at opened this issue Sep 7, 2017 · 1 comment
Open

Incorrectly removing trailing slash from URL #12

sb-relaxt-at opened this issue Sep 7, 2017 · 1 comment
Labels

Comments

@sb-relaxt-at
Copy link

From my understanding removing any trailing slash in rebuildURL is not correct:

return rtrim(http_build_url($defaults, $parts), "/");

The trailing slash could be part of a fragment or query, e.g.:

In these cases we have no knowledge whether or not the trailing slash is meaningful. But even if the trailing slash is part of the path, it might be relevant, as the webserver could serve two different pages (compare Google Webmasterblog). Therefore I would suggest removing the rtrim call.

sb-relaxt-at added a commit to sb-relaxt-at/silverstripe-externalurlfield that referenced this issue Sep 7, 2017
@JamesDPC
Copy link

JamesDPC commented Dec 8, 2021

I encountered this issue when an external site redirected to another external site if the trailing slash was not present.

eg.:

Removing the trailing slash is unexpected and seems arbitrary, could this be updated and released? It's a trivial change.

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

No branches or pull requests

3 participants