access-control-basic-options-not-supported.py (472B)
1 def main(request, response): 2 response.headers.set(b"Cache-Control", b"no-store") 3 4 # Allow simple requests, but deny preflight 5 if request.method != u"OPTIONS": 6 if b"origin" in request.headers: 7 response.headers.set(b"Access-Control-Allow-Credentials", b"true") 8 response.headers.set(b"Access-Control-Allow-Origin", request.headers[b"origin"]) 9 else: 10 response.status = 500 11 else: 12 response.status = 400