Let the hide-referrer code tolerate Referer headers with https:// URLs
authorFabian Keil <fk@fabiankeil.de>
Mon, 14 Dec 2020 11:14:31 +0000 (12:14 +0100)
committerFabian Keil <fk@fabiankeil.de>
Thu, 17 Dec 2020 14:13:56 +0000 (15:13 +0100)
Previously they would always be treated like a changed host.

parsers.c

index d2ef046..185db7d 100644 (file)
--- a/parsers.c
+++ b/parsers.c
@@ -4852,6 +4852,10 @@ static jb_err handle_conditional_hide_referrer_parameter(char **header,
       referer[hostlength+17] = '\0';
    }
    referer_url = strstr(referer, "http://");
       referer[hostlength+17] = '\0';
    }
    referer_url = strstr(referer, "http://");
+   if (NULL == referer_url)
+   {
+      referer_url = strstr(referer, "https://");
+   }
    if ((NULL == referer_url) || (NULL == strstr(referer_url, host)))
    {
       /* Host has changed, Referer is invalid or a https URL. */
    if ((NULL == referer_url) || (NULL == strstr(referer_url, host)))
    {
       /* Host has changed, Referer is invalid or a https URL. */