#45540 [Csd]: stream_context_create creates bad http request
| From: | lbarnaud@php.net | Date: | Thu, 14 May 2009 16:18:34 +0000 |
| Subject: | #45540 [Csd]: stream_context_create creates bad http request | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-137320@lists.php.net to get a copy of this message | ||
ID: 45540
Updated by: lbarnaud@php.net
Reported By: jdespatis at yahoo dot fr
Status: Closed
Bug Type: Streams related
Operating System: Linux Kubuntu
PHP Version: 5.2.6
New Comment:
Now PHP_5_2 branch
Previous Comments:
------------------------------------------------------------------------
[2009-05-14 14:17:46] jani@php.net
Note: The fix was only applied to PHP_5_3 and HEAD branches, it's not
(yet) in PHP_5_2 branch.
------------------------------------------------------------------------
[2008-07-28 19:11:44] lbarnaud@php.net
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
The server replies with a Location header, the HTTP wrapper
automatically redirect, and that second request was effectively invalid
(the request was sent as POST without Content-Length and post data).
------------------------------------------------------------------------
[2008-07-27 08:37:26] jdespatis at yahoo dot fr
Well, i can give you a self-contained reproducing script:
http://www.despatis.com/php/stream.phps
But, it's impossible for me to avoid the use of POST, because this bug
occurs on a http connection..
To run the bug, you just do in the command line (so using php cli):
$ php stream.php
I get the following result, you'll need a sniffer to see that data sent
to http server is completely weird
token :
AIwbFASbZooZXBAePnl4eayE1cZvRWbvOtzQTC-vRR-lkp1r3ijZ7AxoSIzuslTVmufPznylay34ryUPdLRMGh61cidHS29Z7NkKqLVYr2JdNY4iKN0qoVB2MSaV2rmumH_ZJTo3gp7Or0IJlaiMiNEs2R5aNllOYg
Array
(
[type] => 2
[message] =>
file_get_contents(http://uploads.gdata.youtube.com/feeds/api/users/bigbluezen/uploads):
failed to open stream: HTTP request failed! HTTP/1.0 411 Length
Required
[file] =>
/home/enzo/projects/lacartoonerie/download/modules/stream.php
[line] => 101
)
------------------------------------------------------------------------
[2008-07-20 11:10:00] jani@php.net
Ok. Now can you provide a proper self-contained reproducing script. One
that starts with <?php, ends with ?> and can be run on the command line.
ie. no POST required..
------------------------------------------------------------------------
[2008-07-18 16:45:03] jdespatis at yahoo dot fr
enzo@poseidon:~$ cat php-5.2.6/config.nice
#! /bin/sh
#
# Created by configure
'./configure' \
'--enable-sockets' \
'--enable-soap' \
'--with-mysql' \
'--enable-mbstring' \
'--enable-ftp' \
'--with-zlib' \
'--with-openssl' \
'--prefix=/home/enzo/divers/php_compil/' \
'--exec-prefix=/home/enzo/divers/php_compil/' \
'--disable-short-tags' \
"$@"
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/45540
--
Edit this bug report at http://bugs.php.net/?id=45540&edit=1