8000 [Routing] host matching should be case-insensitive · Issue #9072 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Routing] host matching should be case-insensitive #9072

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

Closed
Tobion opened this issue Sep 18, 2013 · 2 comments
Closed

[Routing] host matching should be case-insensitive #9072

Tobion opened this issue Sep 18, 2013 · 2 comments
Labels

Comments

@Tobion
Copy link
Contributor
Tobion commented Sep 18, 2013

The host subcomponent is case-insensitive.

http://tools.ietf.org/html/rfc3986#section-3.2.2

I don't think it is. Remember: The host check when generating urls is also affected.

fabpot added a commit that referenced this issue Oct 9, 2014
…bion)

This PR was merged into the 2.3 branch.

Discussion
----------

[Routing] fix type inconsistencies in RequestContext

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

Fixed inconsistencies in RequestContext:

- [x] port setters and getters inconsistent with constructor (string vs int)
- [x] host should be lowercased for easier case-insensitivity, see #9072
- [x] fix setQueryString with null
- [x] fix return phpdoc typehint

Commits
-------

676c4a0 [Routing] add tests for RequestContext
f61607f [Routing] fix inconsistencies in RequestContext
@thewilkybarkid
Copy link
Contributor

This looks like it can be closed.

@Tobion
Copy link
Contributor Author
Tobion commented Dec 13, 2014

Nope, still relevant.

fabpot added a commit that referenced this issue 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
@fabpot fabpot closed this as completed Feb 5, 2015
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
0