mirror of
https://github.com/servo/servo.git
synced 2025-08-08 23:15:33 +01:00
Update web-platform-tests to revision cfada7e6cb379699fa94c7ed8fcb97082327e10c
This commit is contained in:
parent
87e7e3d429
commit
06b00da16b
179 changed files with 6103 additions and 1186 deletions
|
@ -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")
|
Loading…
Add table
Add a link
Reference in a new issue