diff options
author | corvid <corvid@lavabit.com> | 2009-08-30 18:18:36 +0000 |
---|---|---|
committer | corvid <corvid@lavabit.com> | 2009-08-30 18:18:36 +0000 |
commit | 85c7bffbc3cc8959416686ee80fb2f0ea4fd88c7 (patch) | |
tree | e165ab1c3c5d28d787b19d66f5189875b2a9d2b2 /src/IO/http.c | |
parent | 242652f587a67983ce15bbdfc3ead570724ef85e (diff) |
change no_proxy test from substring to suffix
Diffstat (limited to 'src/IO/http.c')
-rw-r--r-- | src/IO/http.c | 8 |
1 files changed, 7 insertions, 1 deletions
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; } |