From 296e6816ee015aebeffa0e593f640fc609fda724 Mon Sep 17 00:00:00 2001 From: Maurits van Altvorst Date: Sat, 8 Dec 2018 22:37:33 +0100 Subject: [PATCH 1/6] Remove outdated X-Do-Not-Track --- qutebrowser/browser/shared.py | 1 - 1 file changed, 1 deletion(-) diff --git a/qutebrowser/browser/shared.py b/qutebrowser/browser/shared.py index 0bf3301f9..92130be65 100644 --- a/qutebrowser/browser/shared.py +++ b/qutebrowser/browser/shared.py @@ -42,7 +42,6 @@ def custom_headers(url): if dnt_config is not None: dnt = b'1' if dnt_config else b'0' headers[b'DNT'] = dnt - headers[b'X-Do-Not-Track'] = dnt conf_headers = config.instance.get('content.headers.custom', url=url) for header, value in conf_headers.items(): From f5b5aa70ed96e52260f421ae516433241756a2de Mon Sep 17 00:00:00 2001 From: Maurits van Altvorst Date: Sun, 9 Dec 2018 11:15:29 +0100 Subject: [PATCH 2/6] Edit tests --- tests/end2end/features/misc.feature | 6 +++--- tests/unit/browser/test_shared.py | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/end2end/features/misc.feature b/tests/end2end/features/misc.feature index b9677a158..5061a948d 100644 --- a/tests/end2end/features/misc.feature +++ b/tests/end2end/features/misc.feature @@ -331,19 +331,19 @@ Feature: Various utility commands. When I set content.headers.do_not_track to true And I open headers Then the header Dnt should be set to 1 - And the header X-Do-Not-Track should be set to 1 + And the header Do-Not-Track should be set to 1 Scenario: DNT header (off) When I set content.headers.do_not_track to false And I open headers Then the header Dnt should be set to 0 - And the header X-Do-Not-Track should be set to 0 + And the header Do-Not-Track should be set to 0 Scenario: DNT header (unset) When I set content.headers.do_not_track to And I open headers Then the header Dnt should be set to - And the header X-Do-Not-Track should be set to + And the header Do-Not-Track should be set to Scenario: Accept-Language header When I set content.headers.accept_language to en,de diff --git a/tests/unit/browser/test_shared.py b/tests/unit/browser/test_shared.py index 78302d8c1..b855f33ae 100644 --- a/tests/unit/browser/test_shared.py +++ b/tests/unit/browser/test_shared.py @@ -26,18 +26,18 @@ from qutebrowser.browser import shared @pytest.mark.parametrize('dnt, accept_language, custom_headers, expected', [ # DNT - (True, None, {}, {b'DNT': b'1', b'X-Do-Not-Track': b'1'}), - (False, None, {}, {b'DNT': b'0', b'X-Do-Not-Track': b'0'}), + (True, None, {}, {b'DNT': b'1', b'Do-Not-Track': b'1'}), + (False, None, {}, {b'DNT': b'0', b'Do-Not-Track': b'0'}), (None, None, {}, {}), # Accept-Language - (False, 'de, en', {}, {b'DNT': b'0', b'X-Do-Not-Track': b'0', + (False, 'de, en', {}, {b'DNT': b'0', b'Do-Not-Track': b'0', b'Accept-Language': b'de, en'}), # Custom headers - (False, None, {'X-Qute': 'yes'}, {b'DNT': b'0', b'X-Do-Not-Track': b'0', + (False, None, {'X-Qute': 'yes'}, {b'DNT': b'0', b'Do-Not-Track': b'0', b'X-Qute': b'yes'}), # Mixed (False, 'de, en', {'X-Qute': 'yes'}, {b'DNT': b'0', - b'X-Do-Not-Track': b'0', + b'Do-Not-Track': b'0', b'Accept-Language': b'de, en', b'X-Qute': b'yes'}), ]) From c93bb0c1beca131f01f2999ca72259f4c3d185c3 Mon Sep 17 00:00:00 2001 From: Maurits van Altvorst Date: Sun, 9 Dec 2018 14:42:34 +0100 Subject: [PATCH 3/6] Remove Do-Not-Track header, use DNT header instead --- tests/end2end/features/misc.feature | 10 ++++------ tests/unit/browser/test_shared.py | 9 ++++----- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/tests/end2end/features/misc.feature b/tests/end2end/features/misc.feature index 5061a948d..bc94f8862 100644 --- a/tests/end2end/features/misc.feature +++ b/tests/end2end/features/misc.feature @@ -330,20 +330,18 @@ Feature: Various utility commands. Scenario: DNT header When I set content.headers.do_not_track to true And I open headers - Then the header Dnt should be set to 1 - And the header Do-Not-Track should be set to 1 + Then the header DNT should be set to 1 + And the header DNT should be set to 1 Scenario: DNT header (off) When I set content.headers.do_not_track to false And I open headers - Then the header Dnt should be set to 0 - And the header Do-Not-Track should be set to 0 + Then the header DNT should be set to 0 Scenario: DNT header (unset) When I set content.headers.do_not_track to And I open headers - Then the header Dnt should be set to - And the header Do-Not-Track should be set to + Then the header DNT should be set to Scenario: Accept-Language header When I set content.headers.accept_language to en,de diff --git a/tests/unit/browser/test_shared.py b/tests/unit/browser/test_shared.py index b855f33ae..fe57e8e6a 100644 --- a/tests/unit/browser/test_shared.py +++ b/tests/unit/browser/test_shared.py @@ -26,18 +26,17 @@ from qutebrowser.browser import shared @pytest.mark.parametrize('dnt, accept_language, custom_headers, expected', [ # DNT - (True, None, {}, {b'DNT': b'1', b'Do-Not-Track': b'1'}), - (False, None, {}, {b'DNT': b'0', b'Do-Not-Track': b'0'}), + (True, None, {}, {b'DNT': b'1'}), + (False, None, {}, {b'DNT': b'0'}), (None, None, {}, {}), # Accept-Language - (False, 'de, en', {}, {b'DNT': b'0', b'Do-Not-Track': b'0', + (False, 'de, en', {}, {b'DNT': b'0', b'Accept-Language': b'de, en'}), # Custom headers - (False, None, {'X-Qute': 'yes'}, {b'DNT': b'0', b'Do-Not-Track': b'0', + (False, None, {'X-Qute': 'yes'}, {b'DNT': b'0', b'X-Qute': b'yes'}), # Mixed (False, 'de, en', {'X-Qute': 'yes'}, {b'DNT': b'0', - b'Do-Not-Track': b'0', b'Accept-Language': b'de, en', b'X-Qute': b'yes'}), ]) From e203f184114f98c1c9e560875cb87f5aa60f9134 Mon Sep 17 00:00:00 2001 From: Maurits van Altvorst Date: Sun, 9 Dec 2018 14:43:54 +0100 Subject: [PATCH 4/6] Remove redundant line --- tests/end2end/features/misc.feature | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/end2end/features/misc.feature b/tests/end2end/features/misc.feature index bc94f8862..83d5f4731 100644 --- a/tests/end2end/features/misc.feature +++ b/tests/end2end/features/misc.feature @@ -331,7 +331,6 @@ Feature: Various utility commands. When I set content.headers.do_not_track to true And I open headers Then the header DNT should be set to 1 - And the header DNT should be set to 1 Scenario: DNT header (off) When I set content.headers.do_not_track to false From a343f9df286651eba9b16d7e72d7550adc48597c Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Fri, 1 Feb 2019 23:03:44 -0800 Subject: [PATCH 5/6] Fix issues with tests --- tests/end2end/features/misc.feature | 6 +++--- tests/unit/browser/test_shared.py | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/end2end/features/misc.feature b/tests/end2end/features/misc.feature index 83d5f4731..48273bdf8 100644 --- a/tests/end2end/features/misc.feature +++ b/tests/end2end/features/misc.feature @@ -330,17 +330,17 @@ Feature: Various utility commands. Scenario: DNT header When I set content.headers.do_not_track to true And I open headers - Then the header DNT should be set to 1 + Then the header Dnt should be set to 1 Scenario: DNT header (off) When I set content.headers.do_not_track to false And I open headers - Then the header DNT should be set to 0 + Then the header Dnt should be set to 0 Scenario: DNT header (unset) When I set content.headers.do_not_track to And I open headers - Then the header DNT should be set to + Then the header Dnt should be set to Scenario: Accept-Language header When I set content.headers.accept_language to en,de diff --git a/tests/unit/browser/test_shared.py b/tests/unit/browser/test_shared.py index fe57e8e6a..b8da41a02 100644 --- a/tests/unit/browser/test_shared.py +++ b/tests/unit/browser/test_shared.py @@ -30,11 +30,9 @@ from qutebrowser.browser import shared (False, None, {}, {b'DNT': b'0'}), (None, None, {}, {}), # Accept-Language - (False, 'de, en', {}, {b'DNT': b'0', - b'Accept-Language': b'de, en'}), + (False, 'de, en', {}, {b'DNT': b'0', b'Accept-Language': b'de, en'}), # Custom headers - (False, None, {'X-Qute': 'yes'}, {b'DNT': b'0', - b'X-Qute': b'yes'}), + (False, None, {'X-Qute': 'yes'}, {b'DNT': b'0', b'X-Qute': b'yes'}), # Mixed (False, 'de, en', {'X-Qute': 'yes'}, {b'DNT': b'0', b'Accept-Language': b'de, en', From eaffed0b8017961f76418cf6ffd841b7b340f714 Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Wed, 13 Feb 2019 23:29:00 -0800 Subject: [PATCH 6/6] Update changelog --- doc/changelog.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 6b2bc1d71..d5d76b181 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -79,6 +79,7 @@ Fixed - When `scrolling.bar = True` was set in versions before v1.5.0, this now correctly gets migrated to `always` instead of `when-searching`. - Completion highlighting now works again on Qt 5.11.3 and 5.12.1. +- The outdated header `X-Do-Not-Track` is no longer sent. v1.5.2 ------