- if (proxy_host.length())
- yaz_url_set_proxy(yaz_url, proxy_host.c_str());
- Z_HTTP_Response *http_response =
- yaz_url_exec(yaz_url, hreq->path, hreq->method,
+ if (!http_proxy)
+ http_proxy = proxy_host.c_str();
+
+ if (*http_proxy)
+ yaz_url_set_proxy(yaz_url, http_proxy);
+
+ std::string uri;
+ if (hreq->path[0] == '/')
+ {
+ if (default_host.length())
+ uri = default_host + hreq->path;
+ }
+ else
+ uri = hreq->path;
+ Z_HTTP_Response *http_response = 0;
+ if (uri.length())
+ http_response =
+ yaz_url_exec(yaz_url, uri.c_str(), hreq->method,