From:             asbo at iserv dot net
Operating system: Windows XP Professional
PHP version:      5.2.0
PHP Bug Type:     cURL related
Bug description:  Use of CURLOPT_NOBODY yields a 404 inexplicably

Description:
------------
I'm running a default PHP 5.2.0 installation on Apache 2.0.55, XP Pro.

Using cURL, the introduction of the CURLOPT_NOBODY setting results in cURL
receiving a 404 page instead of the actual web page.

In my understanding, the NOBODY setting shouldn't change the actual HTTP
request at all, and therefore I should the same headers regardless of
NOBODY being set or not.

It doesn't seem like I'm missing something important -- feel free to
correct me.

Reproduce code:
---------------
<?php
$ch = curl_init();
  curl_setopt($ch, CURLOPT_URL,
'http://video.google.com/videoplay?docid=1384277706451157121');
  curl_setopt($ch, CURLOPT_HEADER, true);
  curl_setopt($ch, CURLOPT_NOBODY, true);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
  echo curl_exec($ch);
curl_close($ch);
?>

Expected result:
----------------
HTTP/1.1 200 OK
Set-Cookie: sloc=en
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Cache-control: private
Date: Fri, 24 Nov 2006 04:41:12 GMT
Server: GFE/1.3

                                                 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd";><html>

(... etc)

Actual result:
--------------
HTTP/1.1 404 Not Found
Set-Cookie: sloc=en
Content-Type: text/html; charset=UTF-8
Content-Length: 141
Cache-control: private
Date: Fri, 24 Nov 2006 04:49:49 GMT
Server: GFE/1.3

-- 
Edit bug report at http://bugs.php.net/?id=39611&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=39611&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=39611&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=39611&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=39611&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=39611&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=39611&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=39611&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=39611&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=39611&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=39611&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=39611&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=39611&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=39611&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=39611&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=39611&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=39611&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=39611&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=39611&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=39611&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=39611&r=mysqlcfg

Reply via email to