aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2021-04-10 01:39:28 +0000
committerTatsuya Kinoshita <tats@debian.org>2021-04-10 02:14:26 +0000
commit4e2cfffd88fb9f4f9fd3400d2270012603a5f896 (patch)
treef84e7f3afff2aea3934d47e34e21141feac44a05
parentUpdate ChangeLog (diff)
downloadw3m-4e2cfffd88fb9f4f9fd3400d2270012603a5f896.tar.gz
w3m-4e2cfffd88fb9f4f9fd3400d2270012603a5f896.zip
Don't set Referer when data URI scheme
-rw-r--r--main.c6
-rw-r--r--url.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/main.c b/main.c
index d4230c5..7f5e3f2 100644
--- a/main.c
+++ b/main.c
@@ -2944,7 +2944,8 @@ loadLink(char *url, char *target, char *referer, FormList *request)
base = baseURL(Currentbuf);
if ((no_referer_ptr && *no_referer_ptr) ||
base == NULL ||
- base->scheme == SCM_LOCAL || base->scheme == SCM_LOCAL_CGI)
+ base->scheme == SCM_LOCAL || base->scheme == SCM_LOCAL_CGI ||
+ base->scheme == SCM_DATA)
referer = NO_REFERER;
if (referer == NULL)
referer = parsedURL2Str(&Currentbuf->currentURL)->ptr;
@@ -4242,7 +4243,8 @@ goURL0(char *prompt, int relative)
current = baseURL(Currentbuf);
if ((no_referer_ptr && *no_referer_ptr) ||
current == NULL ||
- current->scheme == SCM_LOCAL || current->scheme == SCM_LOCAL_CGI)
+ current->scheme == SCM_LOCAL || current->scheme == SCM_LOCAL_CGI ||
+ current->scheme == SCM_DATA)
referer = NO_REFERER;
else
referer = parsedURL2Str(&Currentbuf->currentURL)->ptr;
diff --git a/url.c b/url.c
index e8f2b29..f099a0e 100644
--- a/url.c
+++ b/url.c
@@ -1456,7 +1456,7 @@ otherinfo(ParsedURL *target, ParsedURL *current, char *referer)
else
#endif
if (referer == NULL && current && current->scheme != SCM_LOCAL &&
- current->scheme != SCM_LOCAL_CGI &&
+ current->scheme != SCM_LOCAL_CGI && current->scheme != SCM_DATA &&
(current->scheme != SCM_FTP ||
(current->user == NULL && current->pass == NULL))) {
char *p = current->label;