From d5d88f419c63a98f7cdef991e63f37b17f9ae413 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 4 Apr 2017 21:05:21 +0200 Subject: [PATCH] fix #68 --- src/php_http_client_request.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/php_http_client_request.c b/src/php_http_client_request.c index de7c0ff..71a9129 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); -- 2.30.2