|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50451 http wrapper breaks on 2048 char long headers
Submitted: 2009-12-11 13:16 UTC Modified: 2009-12-21 10:11 UTC
From: Assigned: iliaa (profile)
Status: Closed Package: Streams related
PHP Version: 5.*, 6 OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2009-12-11 13:16 UTC]
If a HTTP response contains an header of exactly 2048 characters, the
remaining headers are not parsed and are returned in the output.

See also bug #49851.


Reproduce code:
echo file_get_contents('http://localhost/a.php');

header(str_pad('X-Padding: ', 2046, 'x'));
echo "Foo";

Expected result:
The homepage of

Actual result:
Content-Length: 3
Connection: close
Content-Type: text/html



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-13 15:44 UTC]
Automatic comment from SVN on behalf of iliaa
Log: Fixed bug #50451 (http wrapper breaks on 2048 char long headers)

# Improvement on the fix for bug #49851
 [2009-12-14 06:19 UTC]
Not merged yet to PHP_5_2.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 17 02:01:30 2024 UTC