Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Routing] make host matching case-insensitive #13567

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
merged 1 commit into from
Feb 5, 2015

Conversation

Tobion
Copy link
Contributor

@Tobion Tobion commented Jan 31, 2015

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #9072
License MIT
Doc PR

Ignore case in host which means:

  • When generating URLs we leave the case in the host as specified.
  • When matching we always return lower-cased versions of parameters (because of https://github.com/symfony/symfony/blob/2.7/src/Symfony/Component/Routing/RequestContext.php#L190 ) in the host. This is also what browers do. They lowercase the host before sending the request, i.e. WWW.eXample.org is sent as www.example.org. But when using curl for example it sends the host as-is. So the HttpFoundation Request class can actually have a non-lowercased host because it doesn't have this normalization.

@Tobion
Copy link
Contributor Author

Tobion commented Jan 31, 2015

fabbot.io failure is false positive because the CS error is in a fixture that is auto-generated.

@Tobion
Copy link
Contributor Author

Tobion commented Feb 3, 2015

ping @symfony/deciders when this is merged I'll try to rebase and finish #10254

@fabpot
Copy link
Member

fabpot commented Feb 4, 2015

👍

@fabpot fabpot added the Routing label Feb 5, 2015
@fabpot
Copy link
Member

fabpot commented Feb 5, 2015

Thank you @Tobion.

@fabpot fabpot merged commit 952388c into symfony:2.3 Feb 5, 2015
fabpot added a commit that referenced this pull request Feb 5, 2015
This PR was merged into the 2.3 branch.

Discussion
----------

[Routing] make host matching case-insensitive

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #9072
| License       | MIT
| Doc PR        |

Ignore case in host which means:
- When generating URLs we leave the case in the host as specified.
- When matching we always return lower-cased versions of parameters (because of https://github.com/symfony/symfony/blob/2.7/src/Symfony/Component/Routing/RequestContext.php#L190 ) in the host. This is also what browers do. They lowercase the host before sending the request, i.e. WWW.eXample.org is sent as www.example.org. But when using curl for example it sends the host as-is. So the HttpFoundation Request class can actually have a non-lowercased host because it doesn't have this normalization.

Commits
-------

952388c [Routing] make host matching case-insensitive according to RFC 3986
@Tobion Tobion deleted the case-insensitive-host branch February 5, 2015 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.