aboutsummaryrefslogtreecommitdiffstats
path: root/url.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2021-04-17 08:42:01 +0000
committerTatsuya Kinoshita <tats@debian.org>2021-04-17 08:42:01 +0000
commit17a3df7440781c2c1e79a90579ff29ebde8f8e51 (patch)
tree72cbbe86429ee5a417a3ed17747538caa2aa2b73 /url.c
parentUpdate ChangeLog (diff)
downloadw3m-17a3df7440781c2c1e79a90579ff29ebde8f8e51.tar.gz
w3m-17a3df7440781c2c1e79a90579ff29ebde8f8e51.zip
New option localhost_only to restrict connections only to localhost
Bug-Debian: https://github.com/tats/w3m/issues/117
Diffstat (limited to '')
-rw-r--r--url.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/url.c b/url.c
index 55a794d..0c0b709 100644
--- a/url.c
+++ b/url.c
@@ -1696,6 +1696,10 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current,
}
}
+ if (LocalhostOnly && pu->host &&
+ strcasecmp(pu->host, "localhost") && strcasecmp(pu->host, "127.0.0.1"))
+ pu->host = NULL;
+
uf.scheme = pu->scheme;
uf.url = parsedURL2Str(pu)->ptr;
pu->is_nocache = (option->flag & RG_NOCACHE);