X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Fhost.c;h=cece23510b479bb25141a03672d5f7afeaa104f2;hb=a6554f8586863ffa7a4c5c90b5ac636cd4ffbe73;hp=82b94bab6d4f5b2c0398e47b295af6dc419e44c8;hpb=817e3ec506c4095bc4fcc1923cee36153ef4ee43;p=pazpar2-moved-to-github.git diff --git a/src/host.c b/src/host.c index 82b94ba..cece235 100644 --- a/src/host.c +++ b/src/host.c @@ -88,7 +88,13 @@ struct host *find_host(database_hosts_t hosts, const char *url, tproxy = xmalloc (strlen(url) + 10); /* so we can add :port */ strcpy(tproxy, url); - for (cp = tproxy; *cp; cp++) + if (!strncmp(tproxy, "http://", 7)) + cp = tproxy + 7; + else if (!strncmp(tproxy, "https://", 8)) + cp = tproxy + 8; + else + cp = tproxy; + for (; *cp; cp++) if (strchr("/?#~", *cp)) { *cp = '\0';