From:             
Operating system: Windows XP SP3
PHP version:      5.3SVN-2010-10-29 (SVN)
Package:          Streams related
Bug Type:         Bug
Bug description:"From:" header sent on http request when using stream_context.

Description:
------------
When using a stream_context, the "From:" header is added to the request,
even 

though the "From:" header is documented to be used for anonymous FTP
requests.



I don't know how to read the headers being SENT when using a
stream_context, so I 

had to use WireShark. The results below relate to the output of WireShark.





Test script:
---------------
<?php

file_get_contents(

        'http://www.php.net',

        False,

        stream_context_create(

                array(

                        'http' => array(

                                'method' => 'GET',

                                'header' => "User-Agent: Mozilla/5.0 (Windows; 
U; Windows NT 5.1;
en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.18
Safari/534.10\r\n",

                        )

                )

        )

);



Expected result:
----------------
GET / HTTP/1.0

Host: www.php.net

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
AppleWebKit/534.10 

(KHTML, like Gecko) Chrome/8.0.552.18 Safari/534.10



Actual result:
--------------
GET / HTTP/1.0

From: automatecta...@[edited]

Host: www.php.net

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
AppleWebKit/534.10 

(KHTML, like Gecko) Chrome/8.0.552.18 Safari/534.10



-- 
Edit bug report at http://bugs.php.net/bug.php?id=53198&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=53198&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=53198&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=53198&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=53198&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=53198&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=53198&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=53198&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=53198&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=53198&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=53198&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=53198&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=53198&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=53198&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=53198&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=53198&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=53198&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=53198&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=53198&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=53198&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=53198&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=53198&r=mysqlcfg

Reply via email to