summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/resource-timing/resources/preflight.py
blob: f0f6017b4729ec19fb90dd7f6dc7b7848301fb72 (plain)
1
2
3
4
5
6
7
8
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")