From 87b9a2cfebf937ccad6a42b7e01fa930c9b750a2 Mon Sep 17 00:00:00 2001 From: erik_ritter Date: Wed, 13 Oct 2021 14:13:09 -0700 Subject: [PATCH] fix: prevent caching error pages --- superset/views/base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/superset/views/base.py b/superset/views/base.py index 0550bb64814dc..8f0aaa200f810 100644 --- a/superset/views/base.py +++ b/superset/views/base.py @@ -420,7 +420,7 @@ def show_http_exception(ex: HTTPException) -> FlaskResponse: and ex.code in {404, 500} ): path = resource_filename("superset", f"static/assets/{ex.code}.html") - return send_file(path), ex.code + return send_file(path, cache_timeout=0), ex.code return json_errors_response( errors=[ @@ -442,7 +442,7 @@ def show_command_errors(ex: CommandException) -> FlaskResponse: logger.warning(ex) if "text/html" in request.accept_mimetypes and not config["DEBUG"]: path = resource_filename("superset", "static/assets/500.html") - return send_file(path), 500 + return send_file(path, cache_timeout=0), 500 extra = ex.normalized_messages() if isinstance(ex, CommandInvalidError) else {} return json_errors_response( @@ -464,7 +464,7 @@ def show_unexpected_exception(ex: Exception) -> FlaskResponse: logger.exception(ex) if "text/html" in request.accept_mimetypes and not config["DEBUG"]: path = resource_filename("superset", "static/assets/500.html") - return send_file(path), 500 + return send_file(path, cache_timeout=0), 500 return json_errors_response( errors=[