X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fhost.c;fp=src%2Fhost.c;h=cece23510b479bb25141a03672d5f7afeaa104f2;hb=2e17f8b4117fdbefd1c1b6452c7a39c1dab03207;hp=82b94bab6d4f5b2c0398e47b295af6dc419e44c8;hpb=39b3d8d760b9ece769c03d979dd6d9d11fb5c5f7;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';