Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Update header handling to RFC 7230
- Loading branch information
Showing
4 changed files
with
12 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,15 @@ | ||
| --TEST-- | ||
| Bug #60227 (header() cannot detect the multi-line header with CR), \r before \n | ||
| --INI-- | ||
| expose_php=0 | ||
| --FILE-- | ||
| <?php | ||
| header("X-foo: e\n foo"); | ||
| header("X-Foo6: e\rSet-Cookie: ID=123\n d"); | ||
| echo 'foo'; | ||
| ?> | ||
| --EXPECTF-- | ||
|
|
||
| Warning: Header may not contain more than a single header, new line detected in %s on line %d | ||
| foo | ||
| --EXPECTHEADERS-- | ||
| X-foo: e | ||
| foo | ||
| Content-type: text/html; charset=UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,14 @@ | ||
| --TEST-- | ||
| Bug #60227 (header() cannot detect the multi-line header with CR), \0 before \n | ||
| --INI-- | ||
| expose_php=0 | ||
| --FILE-- | ||
| <?php | ||
| header("X-foo: e\n foo"); | ||
| header("X-Foo6: e\0Set-Cookie: ID=\n123\n d"); | ||
| echo 'foo'; | ||
| ?> | ||
| --EXPECTF-- | ||
| Warning: Header may not contain NUL bytes in %s on line %d | ||
| foo | ||
| --EXPECTHEADERS-- | ||
| X-foo: e | ||
| foo | ||
| Content-type: text/html; charset=UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,14 @@ | ||
| --TEST-- | ||
| Bug #60227 (header() cannot detect the multi-line header with CR), CRLF | ||
| --INI-- | ||
| expose_php=0 | ||
| --FILE-- | ||
| <?php | ||
| header("X-foo: e\r\nfoo"); | ||
| header("X-foo: e\r\nfoo"); | ||
| echo 'foo'; | ||
| ?> | ||
| --EXPECTF-- | ||
| Warning: Header may not contain more than a single header, new line detected in %s on line %d | ||
| foo | ||
| --EXPECTHEADERS-- | ||
| X-foo: e | ||
| foo | ||
| Content-type: text/html; charset=UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters