Edit report at https://bugs.php.net/bug.php?id=60887&edit=1

 ID:                 60887
 Comment by:         carloschilazo at gmail dot com
 Reported by:        mail at tomsommer dot dk
 Summary:            SoapClient ignores user_agent option and sends no
                     User-Agent header
 Status:             Open
 Type:               Bug
 Package:            SOAP related
 PHP Version:        5.3.9
 Block user comment: N
 Private report:     N

 New Comment:

After yawk@irc replicated the issue, the problem is that the WSDL request is 
the 
one that is not being sent with the user-agent header set.

Subsequent requests are.

Pending to determine if WSDL request should have user-agent set
 
(replication with screenshots: http://chilldata.com/dev/soapbug/)

Email will be sent to internals mailing list


Previous Comments:
------------------------------------------------------------------------
[2012-01-28 19:16:04] carloschilazo at gmail dot com

Checked it with "User-Agent" and the behavior is the same with and without the 
"-"

Better to be RFC compliant (RFC 2616) and add the '-;, I'll upload the patch 
again.

Thanks!

------------------------------------------------------------------------
[2012-01-28 17:41:14] carloschilazo at gmail dot com

This is what I now get after running your script with my patch

Array
(
   [DOCUMENT_ROOT] => /home/chilld/public_html
   [GATEWAY_INTERFACE] => CGI/1.1
   [HTTP_CONNECTION] => close
   [HTTP_HOST] => pfdn.local.chilldata.com
   [HTTP_USER_AGENT] => foo
   [PATH] => /bin:/usr/bin
   [QUERY_STRING] => check=1
   [REDIRECT_STATUS] => 200
   [REMOTE_ADDR] => 189.253.78.75
   [REMOTE_PORT] => 20615
   [REQUEST_METHOD] => GET
   [REQUEST_URI] => /dev/soap.php?check=1
   [SCRIPT_FILENAME] => /home/chilld/public_html/dev/soap.php
   [SCRIPT_NAME] => /dev/soap.php
   [SERVER_ADDR] => 10.34.11.56
   [SERVER_ADMIN] => webmas...@chilldata.com
   [SERVER_NAME] => www.chilldata.com
   [SERVER_PORT] => 80
   [SERVER_PROTOCOL] => HTTP/1.1
   [SERVER_SIGNATURE] =>
   [SERVER_SOFTWARE] => Apache
   [UNIQUE_ID] => TyOIZK3Hp1AAADUKGtYAAAAL
   [PHP_SELF] => /dev/soap.php
   [REQUEST_TIME] => 1327728740


   [argv] => Array
       (
           [0] => check=1
       )

   [argc] => 1
)


and if i change to see the $_SERVER['HTTP_USER_AGENT'] variable I get also foo

------------------------------------------------------------------------
[2012-01-28 12:31:41] mail at tomsommer dot dk

Regarding your patch, I believe the header is "User-Agent", not "User Agent" :)

------------------------------------------------------------------------
[2012-01-28 09:03:56] carloschilazo at gmail dot com

Oooh sorry, my bad; yeah you were right;

 I've posted a fix, I already tested it with no problem, waiting for someone to 
comment or commit.

------------------------------------------------------------------------
[2012-01-27 10:45:04] mail at tomsommer dot dk

I've tested it on several machines.

It's not a matter of stripping the header, since stream_context works.

My test script:

<?php
if ( isset($_GET['check']) ) {
        mail('y...@example.com', 'ff', print_r(apache_request_headers(), true));
} else {
        $client = new SoapClient('http://example.com/soap.php?check=1', 
array('user_agent' => 'foo'));
}
?>

------------------------------------------------------------------------


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=60887


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=60887&edit=1

Reply via email to