projects
/
metaproxy-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4ee6d6c
)
http_client: simplify check whether URL is abs_path
author
Adam Dickmeiss
<adam@indexdata.dk>
Fri, 3 May 2013 10:40:26 +0000
(12:40 +0200)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Fri, 3 May 2013 10:40:26 +0000
(12:40 +0200)
src/filter_http_client.cpp
patch
|
blob
|
history
diff --git
a/src/filter_http_client.cpp
b/src/filter_http_client.cpp
index
cba6f48
..
7703a97
100644
(file)
--- 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();
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());
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;
}
{
if (default_host.length())
uri = default_host + hreq->path;
}
+ else
+ uri = hreq->path;
Z_HTTP_Response *http_response = 0;
if (uri.length())
http_response =
Z_HTTP_Response *http_response = 0;
if (uri.length())
http_response =