Skip to content

[HttpFoundation] Fix base URI detection on IIS with UrlRewriteModule #51424

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

Merged

Conversation

derrabus
Copy link
Member

@derrabus derrabus commented Aug 18, 2023

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Workaround for php/php-src#11981
License MIT
Doc PR N/A

See the linked PHP issue for details on the issue I'm working around.

If I setup a Symfony application in a IIS virtual directory and use UrlRewriteModule to rewrite all requests to my front controller script, routing requests might fail if I spell the virtual directory with once with lowercase and afterwards with uppercase letters or vice versa.

This PR detects if we're on IIS with active URL rewriting and switches to a more fuzzy base URL detection in that case.

@carsonbot carsonbot added this to the 5.4 milestone Aug 18, 2023
@derrabus derrabus force-pushed the bugfix/iis-rewrite-case-mismatch branch 2 times, most recently from c83f0e2 to a10b903 Compare August 18, 2023 11:00
@nicolas-grekas
Copy link
Member

Thank you @derrabus.

@nicolas-grekas nicolas-grekas force-pushed the bugfix/iis-rewrite-case-mismatch branch from a10b903 to 26aec0f Compare August 21, 2023 07:23
@nicolas-grekas nicolas-grekas merged commit f874dd2 into symfony:5.4 Aug 21, 2023
@derrabus derrabus deleted the bugfix/iis-rewrite-case-mismatch branch August 22, 2023 08:17
This was referenced Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants