Skip to content

Commit

Permalink
Merge pull request #2617 from data-for-change/2586-adding_cors_option…
Browse files Browse the repository at this point in the history
…s_manually_2

Update flask_app.py
  • Loading branch information
tkalir authored Apr 20, 2024
2 parents 0cdebcf + 60f9f88 commit b23fbb5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion anyway/flask_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1099,8 +1099,9 @@ def acc_in_area_query():

@app.after_request
def add_allow_methods_header(response):
if request.method == 'OPTIONS' and request.path.startswith("/api/news-flash/"):
if request.path.startswith("/api/news-flash/"):
response.headers['Access-Control-Allow-Methods'] = "GET, POST, PATCH"
response.headers['Access-Control-Allow-Origin'] = "*"
return response

nf_parser = reqparse.RequestParser()
Expand Down

0 comments on commit b23fbb5

Please sign in to comment.