Skip to content

Commit cc7f997

Browse files
committed
Tidy cors
1 parent 0d111ac commit cc7f997

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

opentopodata/api.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,9 @@ def apply_cors(response):
8585
of the access_control_allow_origin config option.
8686
"""
8787
try:
88-
if _load_config()["access_control_allow_origin"]:
89-
response.headers["access-control-allow-origin"] = _load_config()[
90-
"access_control_allow_origin"
91-
]
88+
cors_value = _load_config()["access_control_allow_origin"]
89+
if cors_value:
90+
response.headers["access-control-allow-origin"] = cors_value
9291
except config.ConfigError:
9392
# If the config isn't loading, allow the request to complete without
9493
# CORS so user can see error message.

0 commit comments

Comments
 (0)