Skip to content

Commit

Permalink
Fix CORS to handle requests where Origin is not set. (#929)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhearsum authored May 29, 2019
1 parent 0473a3c commit e433087
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion auslib/web/admin/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def add_security_headers(response):
response.headers["Access-Control-Allow-Headers"] = "Authorization"
if "*" in app.config["CORS_ORIGINS"]:
response.headers["Access-Control-Allow-Origin"] = "*"
elif request.headers["Origin"] in app.config["CORS_ORIGINS"]:
elif "Origin" in request.headers and request.headers["Origin"] in app.config["CORS_ORIGINS"]:
response.headers["Access-Control-Allow-Origin"] = request.headers["Origin"]
if re.match("^/ui/", request.path):
# This enables swagger-ui to dynamically fetch and
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.65
2.65.1

0 comments on commit e433087

Please sign in to comment.