#50451 [Opn->Asn]: http wrapper breaks on 2048 char long headers

From: Date: Fri, 11 Dec 2009 14:29:34 +0000
Subject: #50451 [Opn->Asn]: http wrapper breaks on 2048 char long headers
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-145641@lists.php.net to get a copy of this message
 ID:               50451
 Updated by:       jani@php.net
 Reported By:      sjoerd@php.net
-Status:           Open
+Status:           Assigned
 Bug Type:         Streams related
 Operating System: Irrelevant
 PHP Version:      5.3SVN-2009-12-11 (SVN)
 Assigned To:      iliaa


Previous Comments:
------------------------------------------------------------------------

[2009-12-11 13:16:01] 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


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=50451&edit=1



Thread (5 messages)

« previous php.bugs (#145641) next »