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

Fix 404 error when URLs have both ending slash and query parameters #3494

Merged
merged 6 commits into from
Apr 8, 2021
Merged

Fix 404 error when URLs have both ending slash and query parameters #3494

merged 6 commits into from
Apr 8, 2021

Conversation

duncanmcclean
Copy link
Member

This PR fixes #3469, where you visiting a page with a URL like this would simply 404, /about/?ref=smth.

@jasonvarga
Copy link
Member

I guess this is fine, and was about to commit this myself earlier, but it bugs me that we do basically the same thing a few lines earlier.

@duncanmcclean
Copy link
Member Author

I guess this is fine, and was about to commit this myself earlier, but it bugs me that we do basically the same thing a few lines earlier.

Huh, that's a good point. Just pushed up a change to get rid of my new code and just update what's already there.

@duncanmcclean
Copy link
Member Author

duncanmcclean commented Apr 7, 2021

I guess this is fine, and was about to commit this myself earlier, but it bugs me that we do basically the same thing a few lines earlier.

Huh, that's a good point. Just pushed up a change to get rid of my new code and just update what's already there.

Nevermind, that seemed to break things, both on my test site and on GH Actions. If you can think of a better/cleaner way, feel free to update this PR/close and commit.

@jasonvarga
Copy link
Member

I'm working on this now so you don't need to do anything, but just an FYI, the test you added already passed before any changes were made.

@jasonvarga
Copy link
Member

Sorry I take that back. It failed on earlier versions of Laravel. 👍

Don't mind me. 🤐

Copy link
Member

@jasonvarga jasonvarga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added tests that cover the original reason that str_finish line and condition were added (other code has been added since then in other spots that makes it work now) and cleaned it up a bit.

@jasonvarga jasonvarga merged commit 9cac7f3 into statamic:3.1 Apr 8, 2021
@duncanmcclean duncanmcclean deleted the fix/3469 branch April 8, 2021 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trailing slash and query string returns 404
2 participants