Edit report at https://bugs.php.net/bug.php?id=45533edit=1
ID: 45533
Comment by: kontakt at myseosolution dot de
Reported by:signe at cothlamadh dot net
Summary:cURL output includes content from redirects when
CURLOPT_FOLLOWLOCATION set
Status: Not a bug
Type: Bug
Package:cURL related
Operating System: FreeBSD 7.0
PHP Version:5.2.6
Assigned To:pajoye
Block user comment: N
Private report: N
New Comment:
I'm experiencing the same problem with version 7.20.0 when trying to login at
Google (https://accounts.google.com/ServiceLogin).
I could not reproduce the error on my own webspace though.
Previous Comments:
[2009-05-03 23:34:59] signe at cothlamadh dot net
I'm not finally back - I was asked for a script that can produce this problem
100% of the time. (When you can provide a script that reproduces this problem
every time, give us feedback.) There is no such thing. It's sporadic - it
will happen with one URL for a while, and then something about the test changes
and it stops reproducing.
There is no discernible pattern to reproduction.
The servers are not in my control so I have no insight into what the original
settings were or what changed when the issue disappears.
I have reproduced it with every PHP up to 5.2.9, and libcurl versions:
7.16.4 (Ubuntu Gutsy)
7.18.2 (Ubuntu Jaunty)
as well as several revisions on FreeBSD that I no longer have available.
[2009-05-03 22:48:53] paj...@php.net
Cannot reproduce it with curl 7.15.5 or 7.19.4.
Cannot reproduce with php or curl with these versions.
[2009-05-03 22:48:08] paj...@php.net
It seems that you are back and finally provide feedback.
The issue is not the headers,
it's that CONTENT from the redirect is included
in the output, and shouldn't be.
Cannot reproduce it with curl 7.15.5 or 7.19.4.
PHP does not alter the contents but get it from cURL. Please check with the
command line (using the same version than php).
[2009-05-03 22:31:50] signe at cothlamadh dot net
You don't understand the issue at all. The issue is not the headers, it's that
CONTENT from the redirect is included in the output, and shouldn't be.
Please fully read the original description.
Output sent from the server during the 3xx response should not be included in
the output given to the user. A server response like this:
HTTP/1.1 302 Found
Location: http://www.example.com/
This document has moved to http://www.example.com
HTTP/1.1 200 Found
This is the output from the new document.
Should not yield output from PHP that says:
This document has moved to http://www.example.com
This is the output from the new document.
The 302 content is supposed to be ignored. CURL does this properly, but in
some circumstances, PHP does NOT. As I detail in the original issue report,
the issue is WORSE when headers are turned on, because the content is included
between the headers, and is impossible to parse out using the header and body
length values returned from curl_getinfo()
[2009-05-03 22:06:29] paj...@php.net
If you ask to include the header in the output, you will get them. Suppress
this line:
curl_setopt($cUrl, CURLOPT_HEADER, true);
The same applies to the cmd line:
curl -i -L http://www.crn.com/rss/cisco/index.xml
vs
curl -L http://www.crn.com/rss/cisco/index.xml
No bug bogus.
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
https://bugs.php.net/bug.php?id=45533
--
Edit this bug report at https://bugs.php.net/bug.php?id=45533edit=1