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

[5.x] Normalize query string when creating nocache session #11545

Open
wants to merge 2 commits into
base: 5.x
Choose a base branch
from

Conversation

duncanmcclean
Copy link
Member

@duncanmcclean duncanmcclean commented Mar 7, 2025

This pull request fixes an issue with the {{ nocache }} tag when used on a URL with "unsorted" query parameters, where the nocache regions wouldn't be returned after the inital page load.

We're already normalizing the query string before looking up a nocache session, just not when we create the nocache session.

Fixes #11543.

#[Test]
public function it_normalizes_query_string()
{
$this->get('/test?utm_source=linkedin.com&utm_medium=referral&utm_campaign=foo');
Copy link
Member Author

Choose a reason for hiding this comment

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

When I comment out my changes in the ServiceProvider this test continues to pass.

It looks like Laravel is normalizing the query string itself in tests, which doesn't happen when I'm testing using Herd.

@duncanmcclean duncanmcclean marked this pull request as ready for review March 7, 2025 11:27
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.

nocache-Tags not being replaced sometimes when URL contains query parameters
1 participant