Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add X-Frame-Options: DENY header
  • Loading branch information
GammaC0de committed Jan 4, 2023
1 parent 8b6aec3 commit bd2a31b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pyload/webui/app/__init__.py
Expand Up @@ -60,11 +60,16 @@ def _configure_themes(cls, app, path_prefix=""):
@classmethod
def _configure_handlers(cls, app):
"""
Register error handlers.
Register app handlers.
"""
for exc, fn in cls.FLASK_ERROR_HANDLERS:
app.register_error_handler(exc, fn)

@app.after_request
def deny_iframe(response):
response.headers["X-Frame-Options"] = "DENY"
return response

@classmethod
def _configure_json_encoding(cls, app):
app.json_encoder = JSONEncoder
Expand Down

0 comments on commit bd2a31b

Please sign in to comment.