mirror of
https://github.com/servo/servo.git
synced 2025-10-16 16:29:18 +01:00
12 lines
464 B
Python
12 lines
464 B
Python
def main(request, response):
|
|
response.headers.set("Cache-Control", "no-store")
|
|
|
|
# Allow simple requests, but deny preflight
|
|
if request.method != "OPTIONS":
|
|
if "origin" in request.headers:
|
|
response.headers.set("Access-Control-Allow-Credentials", "true")
|
|
response.headers.set("Access-Control-Allow-Origin", request.headers["origin"])
|
|
else:
|
|
response.status = 500
|
|
else:
|
|
response.status = 400
|