Update web-platform-tests to revision cfada7e6cb379699fa94c7ed8fcb97082327e10c

This commit is contained in:
WPT Sync Bot 2019-07-31 10:22:21 +00:00
parent 87e7e3d429
commit 06b00da16b
179 changed files with 6103 additions and 1186 deletions

View file

@ -0,0 +1,12 @@
import os
# Returns a valid image response when request's |referrer| matches
# |expected_referrer|.
def main(request, response):
referrer = request.headers.get("referer", "")
expected_referrer = request.GET.first("expected_referrer", "")
response_headers = [("Content-Type", "image/png")]
if referrer == expected_referrer:
image_path = os.path.join(os.path.dirname(__file__), "image.png")
return (200, response_headers, open(image_path, mode='rb').read())
return (404, response_headers, "Not found")