php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68069 Overwriting HTTP headers with stream_context_create
Submitted: 2014-09-22 08:27 UTC Modified: -
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: stereoshoots at gmail dot com Assigned:
Status: Open Package: SOAP related
PHP Version: 5.5.17 OS: FreeBSD
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2014-09-22 08:27 UTC] stereoshoots at gmail dot com
Description:
------------
stream_context_create dont overwrite HTTP headers. I'm trying to overwrite my content-type, but its not being overwrited.

Test script:
---------------
arrHttpHeaders = array(
	'http' => array(
	'header' => 'Content-Type: application/soap+xml; charset=utf-8\r\n
		     Warning: Test warning'
	)
);
$streamContext = stream_context_create($arrHttpHeaders);
				
$arrConfig = array_merge(
	self::getSoapClientConfiguration(), 
	array(
	    'local_cert' => self::getAuthCertificatePath(),
	    'passphrase' => self::getAuthCertificatePassphrase(),
	    'stream_context' => $streamContext
        )
);
				
self::$objSoapClient = new SoapClient(
	self::getSoapClientWsdlPath(), 
	$arrConfig
);

Expected result:
----------------
POST **** HTTP/1.1
Host: ****
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.5.16
Content-Type: application/soap+xml; charset=utf-8
SOAPAction: ***
Content-Length: 234
Warning: Test warning

Actual result:
--------------
POST **** HTTP/1.1
Host: ****
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.5.16
Content-Type: text/xml; charset=utf-8
SOAPAction: ***
Content-Length: 234
Warning: Test warning

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 23:01:28 2024 UTC