Edit report at https://bugs.php.net/bug.php?id=60887&edit=1
ID: 60887
Comment by: mail at tomsommer dot dk
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:
Regarding your patch, I believe the header is "User-Agent", not "User Agent" :)
Previous Comments:
------------------------------------------------------------------------
[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('[email protected]', 'ff', print_r(apache_request_headers(), true));
} else {
$client = new SoapClient('http://example.com/soap.php?check=1',
array('user_agent' => 'foo'));
}
?>
------------------------------------------------------------------------
[2012-01-27 05:07:27] carloschilazo at gmail dot com
Forgot to mention, I tested with 5.3.9 realeased version, and also with the
current snapshot
------------------------------------------------------------------------
[2012-01-27 05:05:53] carloschilazo at gmail dot com
I could not reproduce your problem, using PHP 5.3.9 (linux) was able to send a
request with user_agent header set
I captured with WireShark.... could you please try to:
a) capture with another program (maybe)
b) make sure that on the other end , the user_agent is not being stripped
or provide more info
------------------------------------------------------------------------
[2012-01-26 07:16:20] mail at tomsommer dot dk
Workaround is:
$opts = array(
'http'=>array(
'user_agent' => 'foo'
)
);
$context = stream_context_create($opts);
$client = new SoapClient('http://www.example.com/', array('stream_context' =>
$context));
------------------------------------------------------------------------
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