Skip to content

Commit b00b9ce

Browse files
Merge branch '2.8' into 3.4
* 2.8: [HttpFoundation] Remove support for legacy and risky HTTP headers
2 parents ad72938 + 5034dad commit b00b9ce

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+
3.4.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
3.4.0
511
-----
612

Request.php

+1-12
Original file line numberDiff line numberDiff line change
@@ -1829,18 +1829,7 @@ protected function prepareRequestUri()
18291829
{
18301830
$requestUri = '';
18311831

1832-
if ($this->headers->has('X_ORIGINAL_URL')) {
1833-
// IIS with Microsoft Rewrite Module
1834-
$requestUri = $this->headers->get('X_ORIGINAL_URL');
1835-
$this->headers->remove('X_ORIGINAL_URL');
1836-
$this->server->remove('HTTP_X_ORIGINAL_URL');
1837-
$this->server->remove('UNENCODED_URL');
1838-
$this->server->remove('IIS_WasUrlRewritten');
1839-
} elseif ($this->headers->has('X_REWRITE_URL')) {
1840-
// IIS with ISAPI_Rewrite
1841-
$requestUri = $this->headers->get('X_REWRITE_URL');
1842-
$this->headers->remove('X_REWRITE_URL');
1843-
} elseif ('1' == $this->server->get('IIS_WasUrlRewritten') && '' != $this->server->get('UNENCODED_URL')) {
1832+
if ('1' == $this->server->get('IIS_WasUrlRewritten') && '' != $this->server->get('UNENCODED_URL')) {
18441833
// IIS7 with URL Rewrite: make sure we get the unencoded URL (double slash problem)
18451834
$requestUri = $this->server->get('UNENCODED_URL');
18461835
$this->server->remove('UNENCODED_URL');

Tests/RequestTest.php

-44
Original file line numberDiff line numberDiff line change
@@ -1905,52 +1905,8 @@ public function iisRequestUriProvider()
19051905
{
19061906
return array(
19071907
array(
1908-
array(
1909-
'X_ORIGINAL_URL' => '/foo/bar',
1910-
),
1911-
array(),
1912-
'/foo/bar',
1913-
),
1914-
array(
1915-
array(
1916-
'X_REWRITE_URL' => '/foo/bar',
1917-
),
19181908
array(),
1919-
'/foo/bar',
1920-
),
1921-
array(
1922-
array(),
1923-
array(
1924-
'IIS_WasUrlRewritten' => '1',
1925-
'UNENCODED_URL' => '/foo/bar',
1926-
),
1927-
'/foo/bar',
1928-
),
1929-
array(
1930-
array(
1931-
'X_ORIGINAL_URL' => '/foo/bar',
1932-
),
1933-
array(
1934-
'HTTP_X_ORIGINAL_URL' => '/foo/bar',
1935-
),
1936-
'/foo/bar',
1937-
),
1938-
array(
1939-
array(
1940-
'X_ORIGINAL_URL' => '/foo/bar',
1941-
),
1942-
array(
1943-
'IIS_WasUrlRewritten' => '1',
1944-
'UNENCODED_URL' => '/foo/bar',
1945-
),
1946-
'/foo/bar',
1947-
),
1948-
array(
1949-
array(
1950-
'X_ORIGINAL_URL' => '/foo/bar',
1951-
),
19521909
array(
1953-
'HTTP_X_ORIGINAL_URL' => '/foo/bar',
19541910
'IIS_WasUrlRewritten' => '1',
19551911
'UNENCODED_URL' => '/foo/bar',
19561912
),

0 commit comments

Comments
 (0)