diff options
Diffstat (limited to 'testing/web-platform/tests/resource-timing/resources/preflight.py')
-rw-r--r-- | testing/web-platform/tests/resource-timing/resources/preflight.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/testing/web-platform/tests/resource-timing/resources/preflight.py b/testing/web-platform/tests/resource-timing/resources/preflight.py new file mode 100644 index 0000000000..f0f6017b47 --- /dev/null +++ b/testing/web-platform/tests/resource-timing/resources/preflight.py @@ -0,0 +1,9 @@ +def main(request, response): + response.headers.set(b"Access-Control-Allow-Origin", b"*") + response.headers.set(b"Access-Control-Max-Age", b"0") + response.headers.set(b"Timing-Allow-Origin", b"*") + # If this script is accessed with the header X-Require-Preflight then the + # browser will send a preflight request. Otherwise it won't. + if request.method == u'OPTIONS': + response.headers.set(b"Access-Control-Allow-Headers", + b"X-Require-Preflight") |