diff options
Diffstat (limited to 'ext/soap/php_sdl.c')
-rw-r--r-- | ext/soap/php_sdl.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index eeedc510f1..d250850786 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -3196,6 +3196,8 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC) smart_str headers = {0}; char* key = NULL; time_t t = time(0); + zend_bool has_proxy_authorization = 0; + zend_bool has_authorization = 0; if (strchr(uri,':') != NULL || IS_ABSOLUTE_PATH(uri, uri_len)) { uri_len = strlen(uri); @@ -3299,10 +3301,10 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC) zval_ptr_dtor(&str_proxy); } - proxy_authentication(this_ptr, &headers TSRMLS_CC); + has_proxy_authorization = proxy_authentication(this_ptr, &headers TSRMLS_CC); } - basic_authentication(this_ptr, &headers TSRMLS_CC); + has_authorization = basic_authentication(this_ptr, &headers TSRMLS_CC); /* Use HTTP/1.1 with "Connection: close" by default */ if (php_stream_context_get_option(context, "http", "protocol_version", &tmp) == FAILURE) { @@ -3311,7 +3313,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC) ZVAL_DOUBLE(http_version, 1.1); php_stream_context_set_option(context, "http", "protocol_version", http_version); zval_ptr_dtor(&http_version); - smart_str_appendl(&headers, "Connection: close", sizeof("Connection: close")-1); + smart_str_appendl(&headers, "Connection: close\r\n", sizeof("Connection: close\r\n")-1); } if (headers.len > 0) { @@ -3319,6 +3321,8 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC) if (!context) { context = php_stream_context_alloc(TSRMLS_C); + } else { + http_context_headers(context, has_authorization, has_proxy_authorization, 0, &headers TSRMLS_CC); } smart_str_0(&headers); |