mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-11 13:48:23 +02:00
Automatic update from web-platform-testsMove http/ tests into fetch/ and html/ (#10870) As discussed in https://github.com/w3c/web-platform-tests/pull/10839. -- wpt-commits: e1fb329f9cddd385706f78ecba642c84c6936c9f wpt-pr: 10870 --HG-- rename : testing/web-platform/tests/http/content_length.html => testing/web-platform/tests/fetch/content-length/content-length.html rename : testing/web-platform/tests/http/content_length.html.headers => testing/web-platform/tests/fetch/content-length/content-length.html.headers rename : testing/web-platform/tests/http/basic-auth-cache-test-ref.html => testing/web-platform/tests/fetch/http-cache/basic-auth-cache-test-ref.html rename : testing/web-platform/tests/http/refresh/navigate.window.js => testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/navigate.window.js rename : testing/web-platform/tests/http/refresh/resources/multiple.asis => testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/multiple.asis rename : testing/web-platform/tests/http/refresh/resources/refresh.py => testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/refresh.py rename : testing/web-platform/tests/http/refresh/resources/refreshed.txt => testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/refreshed.txt rename : testing/web-platform/tests/http/refresh/subresource.any.js => testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/subresource.any.js
17 lines
597 B
Python
17 lines
597 B
Python
# -*- coding: utf-8 -
|
|
|
|
def main(request, response):
|
|
image_url = str.replace(request.url, "fetch/http-cache/resources/securedimage.py", "images/green.png")
|
|
|
|
if "authorization" not in request.headers:
|
|
response.status = 401
|
|
response.headers.set("WWW-Authenticate", "Basic")
|
|
return
|
|
else:
|
|
auth = request.headers.get("Authorization")
|
|
if auth != "Basic dGVzdHVzZXI6dGVzdHBhc3M=":
|
|
response.set_error(403, "Invalid username or password - " + auth)
|
|
return
|
|
|
|
response.status = 301
|
|
response.headers.set("Location", image_url)
|