|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44603 HTTP streams wrapper issue with Content-Type header
Submitted: 2008-04-02 02:38 UTC Modified: 2008-04-08 00:03 UTC
From: tobias382 at gmail dot com Assigned: iliaa (profile)
Status: Closed Package: HTTP related
PHP Version: 5.2CVS, 5.3CVS (2008-04-02) OS: Kubuntu 7.10
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:
From: tobias382 at gmail dot com
New email:
PHP Version: OS:


 [2008-04-02 02:38 UTC] tobias382 at gmail dot com
Specifying a Content-type header in a streams operation using the HTTP wrapper causes a file_get_contents operation using that streams context to fail. Not specifying the Content-type header results in a Notice being issued saying that application/x-www-form-urlencoded is assumed and the script then works as expected.

Reproduce code:

Expected result:
Should send a URL in the following format to stdout, where # is a number.

Actual result:
Warning: file_get_contents( failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/matt/pastebin.php on line 21


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-02 15:22 UTC] tobias382 at gmail dot com
The issue is still present in this snapshot: php5.2-200804021430.
 [2008-04-03 14:05 UTC]
There is indeed something very wrong with this. Quick stracing suggests that the order in which the headers are is maybe incorrect and there's an extra '\r\n' there..
 [2008-04-06 15:22 UTC]
Fixed in 6 and 5.3, needs to be MFHed to 5.2 post 5.2.6
 [2008-04-08 00:03 UTC]
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
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 23 05:01:28 2024 UTC