X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=src%2Fphp_http_client_request.c;h=9055f490f379097411ed6b73fb86b68e0a4c1646;hp=de7c0ff2535322bf685f157f0e1301e959bbf297;hb=d5d03014cff8c8ca80ee7866af100d3ceae1bd8f;hpb=0ccb6d6575f81affd97a78ba1a88641ad41b4b55 diff --git a/src/php_http_client_request.c b/src/php_http_client_request.c index de7c0ff..9055f49 100644 --- a/src/php_http_client_request.c +++ b/src/php_http_client_request.c @@ -59,7 +59,12 @@ static PHP_METHOD(HttpClientRequest, __construct) PHP_HTTP_INFO(obj->message).request.method = estrndup(meth_str, meth_len); } if (zurl) { - PHP_HTTP_INFO(obj->message).request.url = php_http_url_from_zval(zurl, PHP_HTTP_URL_STDFLAGS); + php_http_url_t *url = php_http_url_from_zval(zurl, PHP_HTTP_URL_STDFLAGS); + + if (url) { + PHP_HTTP_INFO(obj->message).request.url = php_http_url_mod(url, NULL, PHP_HTTP_URL_STDFLAGS); + php_http_url_free(&url); + } } if (zheaders) { array_copy(Z_ARRVAL_P(zheaders), &obj->message->hdrs); @@ -268,7 +273,7 @@ static PHP_METHOD(HttpClientRequest, getSslOptions) } static zend_function_entry php_http_client_request_methods[] = { - PHP_ME(HttpClientRequest, __construct, ai_HttpClientRequest___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) + PHP_ME(HttpClientRequest, __construct, ai_HttpClientRequest___construct, ZEND_ACC_PUBLIC) PHP_ME(HttpClientRequest, setContentType, ai_HttpClientRequest_setContentType, ZEND_ACC_PUBLIC) PHP_ME(HttpClientRequest, getContentType, ai_HttpClientRequest_getContentType, ZEND_ACC_PUBLIC) PHP_ME(HttpClientRequest, setQuery, ai_HttpClientRequest_setQuery, ZEND_ACC_PUBLIC)