X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Ffilter_http_client.cpp;h=7703a97a9d52e752287483d0259b7e6d72d68a87;hb=b1ca965f09c0dd217f9f5147f3f7009ec0f6d292;hp=cba6f48a70d2b8315824abdb132be46c62aa9aae;hpb=519cf04ede8ce910b4048b98c8150adb8d983204;p=metaproxy-moved-to-github.git diff --git a/src/filter_http_client.cpp b/src/filter_http_client.cpp index cba6f48..7703a97 100644 --- a/src/filter_http_client.cpp +++ b/src/filter_http_client.cpp @@ -71,19 +71,18 @@ void yf::HTTPClient::Rep::proxy(mp::Package &package) Z_GDU *res_gdu = 0; mp::odr o; yaz_url_t yaz_url = yaz_url_create(); - const char *h = strchr(hreq->path, '/'); std::string uri; if (proxy_host.length()) yaz_url_set_proxy(yaz_url, proxy_host.c_str()); - if (h > hreq->path+1 && !memcmp(h-1, "://", 3)) - uri = hreq->path; /* we have a host already */ - else + 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 =