1
0
mirror of https://github.com/quay/quay.git synced 2026-01-26 06:21:37 +03:00

cors: check for request_origin being set (PROJQUAY-5213) (#1811)

Some browsers might not set the Origin header
in the request. Ignore the origin check in such
cases
This commit is contained in:
Syed Ahmed
2023-03-28 06:13:34 -04:00
committed by GitHub
parent b2a5b3abb7
commit 98d89a1fce

View File

@@ -39,7 +39,7 @@ def crossorigin(anonymous=True):
# the Origin header from the request to set the
# correct Allow-Origin
request_origin = request.headers.get("Origin")
if request_origin in cors_origin_list:
if request_origin and request_origin in cors_origin_list:
cors_origin = request_origin
headers = BASE_CROSS_DOMAIN_HEADERS