Skip to content

Commit

Permalink
Attempt at fixing CORS issue on external embed
Browse files Browse the repository at this point in the history
  • Loading branch information
sdl60660 committed Jan 27, 2021
1 parent 59afc9c commit 997e79a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ def redirect_to_new_domain():
urlparts_list[1] = TO_DOMAIN
return redirect(urlunparse(urlparts_list), code=301)

@app.after_request
def after_request(response):
header = response.headers
header['Access-Control-Allow-Origin'] = '*'
return response

@app.route('/')
def homepage():
return render_template('index.html')
Expand Down

0 comments on commit 997e79a

Please sign in to comment.