php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch add_custom_http_header.patch for SOAP related Bug #51551

Patch version 2010-04-13 16:47 UTC

Return to Bug #51551 | Download this patch
Patch Revisions:

Developer: ed@atl.org

Index: ext/soap/soap.c
===================================================================
--- ext/soap/soap.c	(revision 297964)
+++ ext/soap/soap.c	(working copy)
@@ -2657,6 +2657,11 @@
 		    Z_TYPE_PP(tmp) == IS_STRING) {
 			add_property_stringl(this_ptr, "_user_agent", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
 		}
+
+                if (zend_hash_find(ht, "custom_http_header", sizeof("custom_http_header"), (void**)&tmp) == SUCCESS &&
+                    Z_TYPE_PP(tmp) == IS_STRING) {
+                        add_property_stringl(this_ptr, "_custom_http_header", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
+                }
 	} else if (Z_TYPE_P(wsdl) == IS_NULL) {
 		php_error_docref(NULL TSRMLS_CC, E_ERROR, "'location' and 'uri' options are required in nonWSDL mode");
 	}
Index: ext/soap/php_http.c
===================================================================
--- ext/soap/php_http.c	(revision 297964)
+++ ext/soap/php_http.c	(working copy)
@@ -749,6 +749,14 @@
 			}
 		}
 
+		if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_custom_http_header", sizeof("_custom_http_header"), (void **)&tmp) == SUCCESS &&
+				Z_TYPE_PP(tmp) == IS_STRING) {
+			if (Z_STRLEN_PP(tmp) > 0) {
+				smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+				smart_str_append_const(&soap_headers, "\r\n");
+			}
+		}
+
 		smart_str_append_const(&soap_headers, "\r\n");
 		smart_str_0(&soap_headers);
 		if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS &&
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 15 19:01:34 2024 UTC