From 85c7bffbc3cc8959416686ee80fb2f0ea4fd88c7 Mon Sep 17 00:00:00 2001 From: corvid Date: Sun, 30 Aug 2009 18:18:36 +0000 Subject: change no_proxy test from substring to suffix --- src/IO/http.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/IO') diff --git a/src/IO/http.c b/src/IO/http.c index c8562fbf..dd6ed3ca 100644 --- a/src/IO/http.c +++ b/src/IO/http.c @@ -396,9 +396,15 @@ static int Http_must_use_proxy(const DilloUrl *url) if (HTTP_Proxy) { ret = 1; if (prefs.no_proxy) { + const char *host = URL_HOST(url); + size_t host_len = strlen(host); + np = dStrdup(prefs.no_proxy); for (p = np; (tok = dStrsep(&p, " ")); ) { - if (dStristr(URL_AUTHORITY(url), tok)) { + int start = host_len - strlen(tok); + + if (start >= 0 && dStrcasecmp(host + start, tok) == 0) { + /* no_proxy token is suffix of host string */ ret = 0; break; } -- cgit v1.2.3