Remove Do-Not-Track header, use DNT header instead

This commit is contained in:
Maurits van Altvorst 2018-12-09 14:42:34 +01:00
parent f5b5aa70ed
commit c93bb0c1be
2 changed files with 8 additions and 11 deletions

View File

@ -330,20 +330,18 @@ Feature: Various utility commands.
Scenario: DNT header Scenario: DNT header
When I set content.headers.do_not_track to true When I set content.headers.do_not_track to true
And I open headers And I open headers
Then the header Dnt should be set to 1 Then the header DNT should be set to 1
And the header Do-Not-Track should be set to 1 And the header DNT should be set to 1
Scenario: DNT header (off) Scenario: DNT header (off)
When I set content.headers.do_not_track to false When I set content.headers.do_not_track to false
And I open headers And I open headers
Then the header Dnt should be set to 0 Then the header DNT should be set to 0
And the header Do-Not-Track should be set to 0
Scenario: DNT header (unset) Scenario: DNT header (unset)
When I set content.headers.do_not_track to <empty> When I set content.headers.do_not_track to <empty>
And I open headers And I open headers
Then the header Dnt should be set to <unset> Then the header DNT should be set to <unset>
And the header Do-Not-Track should be set to <unset>
Scenario: Accept-Language header Scenario: Accept-Language header
When I set content.headers.accept_language to en,de When I set content.headers.accept_language to en,de

View File

@ -26,18 +26,17 @@ from qutebrowser.browser import shared
@pytest.mark.parametrize('dnt, accept_language, custom_headers, expected', [ @pytest.mark.parametrize('dnt, accept_language, custom_headers, expected', [
# DNT # DNT
(True, None, {}, {b'DNT': b'1', b'Do-Not-Track': b'1'}), (True, None, {}, {b'DNT': b'1'}),
(False, None, {}, {b'DNT': b'0', b'Do-Not-Track': b'0'}), (False, None, {}, {b'DNT': b'0'}),
(None, None, {}, {}), (None, None, {}, {}),
# Accept-Language # 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'}), b'Accept-Language': b'de, en'}),
# Custom headers # 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'}), b'X-Qute': b'yes'}),
# Mixed # Mixed
(False, 'de, en', {'X-Qute': 'yes'}, {b'DNT': b'0', (False, 'de, en', {'X-Qute': 'yes'}, {b'DNT': b'0',
b'Do-Not-Track': b'0',
b'Accept-Language': b'de, en', b'Accept-Language': b'de, en',
b'X-Qute': b'yes'}), b'X-Qute': b'yes'}),
]) ])