Skip to content

Commit e5a8475

Browse files
Merge branch '3.4' into 4.0
* 3.4: [HttpFoundation] Remove support for legacy and risky HTTP headers
2 parents e0e05e9 + b00b9ce commit e5a8475

File tree

3 files changed

+7
-56
lines changed

3 files changed

+7
-56
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
CHANGELOG
22
=========
33

4+
4.0.14
5+
------
6+
7+
* [BC BREAK] Support for the IIS-only `X_ORIGINAL_URL` and `X_REWRITE_URL`
8+
HTTP headers has been dropped for security reasons.
9+
410
4.0.0
511
-----
612

Request.php

+1-12
Original file line numberDiff line numberDiff line change
@@ -1691,18 +1691,7 @@ protected function prepareRequestUri()
16911691
{
16921692
$requestUri = '';
16931693

1694-
if ($this->headers->has('X_ORIGINAL_URL')) {
1695-
// IIS with Microsoft Rewrite Module
1696-
$requestUri = $this->headers->get('X_ORIGINAL_URL');
1697-
$this->headers->remove('X_ORIGINAL_URL');
1698-
$this->server->remove('HTTP_X_ORIGINAL_URL');
1699-
$this->server->remove('UNENCODED_URL');
1700-
$this->server->remove('IIS_WasUrlRewritten');
1701-
} elseif ($this->headers->has('X_REWRITE_URL')) {
1702-
// IIS with ISAPI_Rewrite
1703-
$requestUri = $this->headers->get('X_REWRITE_URL');
1704-
$this->headers->remove('X_REWRITE_URL');
1705-
} elseif ('1' == $this->server->get('IIS_WasUrlRewritten') && '' != $this->server->get('UNENCODED_URL')) {
1694+
if ('1' == $this->server->get('IIS_WasUrlRewritten') && '' != $this->server->get('UNENCODED_URL')) {
17061695
// IIS7 with URL Rewrite: make sure we get the unencoded URL (double slash problem)
17071696
$requestUri = $this->server->get('UNENCODED_URL');
17081697
$this->server->remove('UNENCODED_URL');

Tests/RequestTest.php

-44
Original file line numberDiff line numberDiff line change
@@ -1822,52 +1822,8 @@ public function iisRequestUriProvider()
18221822
{
18231823
return array(
18241824
array(
1825-
array(
1826-
'X_ORIGINAL_URL' => '/foo/bar',
1827-
),
1828-
array(),
1829-
'/foo/bar',
1830-
),
1831-
array(
1832-
array(
1833-
'X_REWRITE_URL' => '/foo/bar',
1834-
),
18351825
array(),
1836-
'/foo/bar',
1837-
),
1838-
array(
1839-
array(),
1840-
array(
1841-
'IIS_WasUrlRewritten' => '1',
1842-
'UNENCODED_URL' => '/foo/bar',
1843-
),
1844-
'/foo/bar',
1845-
),
1846-
array(
1847-
array(
1848-
'X_ORIGINAL_URL' => '/foo/bar',
1849-
),
1850-
array(
1851-
'HTTP_X_ORIGINAL_URL' => '/foo/bar',
1852-
),
1853-
'/foo/bar',
1854-
),
1855-
array(
1856-
array(
1857-
'X_ORIGINAL_URL' => '/foo/bar',
1858-
),
1859-
array(
1860-
'IIS_WasUrlRewritten' => '1',
1861-
'UNENCODED_URL' => '/foo/bar',
1862-
),
1863-
'/foo/bar',
1864-
),
1865-
array(
1866-
array(
1867-
'X_ORIGINAL_URL' => '/foo/bar',
1868-
),
18691826
array(
1870-
'HTTP_X_ORIGINAL_URL' => '/foo/bar',
18711827
'IIS_WasUrlRewritten' => '1',
18721828
'UNENCODED_URL' => '/foo/bar',
18731829
),

0 commit comments

Comments
 (0)