php.net |  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: sjoerd@php.net Assigned: iliaa (profile)
Status: Closed Package: Streams related
PHP Version: 5.*, 6 OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sjoerd@php.net
New email:
PHP Version: OS:

 

 [2009-12-11 13:16 UTC] sjoerd@php.net
Description:
------------
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:
---------------
<?php
echo file_get_contents('http://localhost/a.php');
?>

a.php:
<?php
header(str_pad('X-Padding: ', 2046, 'x'));
header('Location: http://www.google.nl/');
echo "Foo";
?>

Expected result:
----------------
The homepage of google.nl.

Actual result:
--------------
Location: http://www.google.nl/
Content-Length: 3
Connection: close
Content-Type: text/html

Foo

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-13 15:44 UTC] svn@php.net
Automatic comment from SVN on behalf of iliaa
Revision: http://svn.php.net/viewvc/?view=revision&revision=292079
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] jani@php.net
Not merged yet to PHP_5_2.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 11:01:29 2024 UTC