Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[HttpFoundation] fixes creation of sub requests under IIS & Rewite Module #7606

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
Apr 20, 2013
Merged

[HttpFoundation] fixes creation of sub requests under IIS & Rewite Module #7606

merged 1 commit into from
Apr 20, 2013

Conversation

bendavies
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #6936, #6923
License MIT
Doc PR N/A

There are a few bugs to address.

  1. HTTP_X_ORIGINAL_URL wasn't removed from the server parameters, so is picked back up here upon recreation of a sub request.
  2. When X_ORIGINAL_URL is passed in the headers by IIS, IIS_WasUrlRewritten and UNENCODED_URL can also be passed as server vars, so they must also be removed for sub request URI's to be resolved correctly.

Additionally, I have removed the OS check for windows, because it was only done for 2 out of 4 of the IIS specific checks, and it made the code untestable.

Also added tests for all scenarios as there were none.

@bendavies
Copy link
Contributor Author

ping @fabpot

fabpot added a commit that referenced this pull request Apr 20, 2013
This PR was merged into the 2.1 branch.

Discussion
----------

[HttpFoundation] fixes creation of sub requests under IIS & Rewite Module

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #6936, #6923
| License       | MIT
| Doc PR        | N/A

There are a few bugs to address.

1. `HTTP_X_ORIGINAL_URL` wasn't removed from the server parameters, so is picked back up [here](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpFoundation/ServerBag.php#L33) upon recreation of a sub request.
2. When `X_ORIGINAL_URL` is passed in the headers by IIS, `IIS_WasUrlRewritten` and `UNENCODED_URL` can also be passed as server vars, so they must also be removed for sub request URI's to be resolved correctly.

Additionally, I have removed the OS check for windows, because it was only done for 2 out of 4 of the IIS specific checks, and it made the code untestable.

Also added tests for all scenarios as there were none.

Commits
-------

9fcd2f6 [HttpFoundation] fixed the creation of sub-requests under some circumstances for IIS
@fabpot fabpot merged commit 9fcd2f6 into symfony:2.1 Apr 20, 2013
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.

2 participants