commit 4b3855118905aee2d2606e2d6bf83560e1f0d780
parent 0a812115216cadf5770a3d9b56f1208cac21f8f5
Author: htrb <htrb>
Date: Sat, 11 Dec 2010 13:00:11 +0000
[w3m-dev 04421] Patch to prevent sending Referer: ' header from HTTPS to HTTP
Diffstat:
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,8 @@
+2010-12-11 theme.of.n@gmail.com
+
+ * [w3m-dev 04421] Patch to prevent sending `Referer: ' header from HTTPS to HTTP
+ * url.c (otherinfo): Don't send Referer: if https:// -> http://
+
2010-10-11 d+w3m@vdr.jp
* [w3m-dev 04414] Re: "normal" bugs from bugs.debian.org
diff --git a/url.c b/url.c
@@ -1307,6 +1307,12 @@ otherinfo(ParsedURL *target, ParsedURL *current, char *referer)
Strcat_charp(s, "Cache-control: no-cache\r\n");
}
if (!NoSendReferer) {
+#ifdef USE_SSL
+ if (current && current->scheme == SCM_HTTPS && target->scheme != SCM_HTTPS) {
+ /* Don't send Referer: if https:// -> http:// */
+ }
+ else
+#endif
if (referer == NULL && current && current->scheme != SCM_LOCAL &&
(current->scheme != SCM_FTP ||
(current->user == NULL && current->pass == NULL))) {