diff --git a/qutebrowser/browser/qtnetworkdownloads.py b/qutebrowser/browser/qtnetworkdownloads.py index 09da5fea2..586570390 100644 --- a/qutebrowser/browser/qtnetworkdownloads.py +++ b/qutebrowser/browser/qtnetworkdownloads.py @@ -396,7 +396,11 @@ class DownloadManager(downloads.AbstractDownloadManager): _MAX_REDIRECTS: The maximum redirection count. """ - _MAX_REDIRECTS = 10 + # Same as many browsers + # https://fetch.spec.whatwg.org/#http-redirect-fetch + # https://source.chromium.org/chromium/chromium/src/+/main:net/url_request/url_request.h;l=97;drc=3c19a2edb96d3d5b56a7481349a357fdbdf8ecf0 + # https://stackoverflow.com/questions/9384474/in-chrome-how-many-redirects-are-too-many + _MAX_REDIRECTS = 20 def __init__(self, parent=None): super().__init__(parent) diff --git a/tests/end2end/features/downloads.feature b/tests/end2end/features/downloads.feature index d0646efb8..af59838cd 100644 --- a/tests/end2end/features/downloads.feature +++ b/tests/end2end/features/downloads.feature @@ -576,7 +576,7 @@ Feature: Downloading things from a website. Scenario: Downloading with infinite redirect When I set downloads.location.prompt to false - And I run :download http://localhost:(port)/redirect/12 --dest redirection + And I run :download http://localhost:(port)/redirect/21 --dest redirection Then the error "Download error: Too many redirects" should be shown And the downloaded file redirection should not exist diff --git a/tests/end2end/fixtures/webserver.py b/tests/end2end/fixtures/webserver.py index b2e981801..fc76c959d 100644 --- a/tests/end2end/fixtures/webserver.py +++ b/tests/end2end/fixtures/webserver.py @@ -85,7 +85,7 @@ class Request(testprocess.Line): '/500-inline': [HTTPStatus.INTERNAL_SERVER_ERROR], '/500': [HTTPStatus.INTERNAL_SERVER_ERROR], } - for i in range(15): + for i in range(25): path_to_statuses['/redirect/{}'.format(i)] = [HTTPStatus.FOUND] for suffix in ['', '1', '2', '3', '4', '5', '6']: key = ('/basic-auth/user{suffix}/password{suffix}'