|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58442 http_parse_message cuts off more than headers
Submitted: 2008-12-02 23:01 UTC Modified: 2008-12-05 04:12 UTC
From: brian at brianmckenna dot org Assigned: mike (profile)
Status: Closed Package: pecl_http (PECL)
PHP Version: 5.2.5 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
44 + 1 = ?
Subscribe to this entry?

 [2008-12-02 23:01 UTC] brian at brianmckenna dot org
I just found that with the URL "", http_parse_message cuts off more than the headers and removes some of the message's content.

This is because in between the headers and the content there is "\n\r\n" instead of the "\n\n" or "\n\r\n\r" that _http_locate_body expects.

My current work-around is just replacing all occurrences of "\r" with "" after I call http_get then use http_parse_message.

Reproduce code:
Code to reproduce:

Patch to stop behaviour:

Expected result:
<html><head><link rel="stylesheet" type="text/css" href="">
<link rel="shortcut icon" href="">
function byId(id) {
  return document.getElementById(id);

function vote(node) {
  var v =;   // {'up', '123'}
  var item = v[1]; 

  // adjust score

Actual result:
function vote(node) {
  var v =;   // {'up', '123'}
  var item = v[1]; 

  // adjust score


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-03 03:57 UTC]
I'll need some time to investigate this issue.  There's for sure been a good reason why it currently is like it is.

Thanks a lot for this report.
 [2008-12-05 04:12 UTC]
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on

In case this was a website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PECL better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Dec 09 22:01:27 2023 UTC