From 4f01a92d6bd604842174c780395b7ebe35cdc93f Mon Sep 17 00:00:00 2001 From: Jumana Bahrainwala Date: Tue, 7 Nov 2023 12:39:00 -0500 Subject: [PATCH] Remove server from response --- gunicorn_config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gunicorn_config.py b/gunicorn_config.py index 665655e00a..e931e9d223 100644 --- a/gunicorn_config.py +++ b/gunicorn_config.py @@ -2,6 +2,7 @@ import sys import traceback +import gunicorn import newrelic.agent # See https://bit.ly/2xBVKBH newrelic.agent.initialize() # noqa: E402 @@ -11,6 +12,8 @@ worker_connections = 256 bind = "0.0.0.0:{}".format(os.getenv("PORT")) accesslog = "-" +# Guincorn sets the server type on our app. We don't want to show it in the header in the response. +gunicorn.SERVER = "Undisclosed" on_aws = os.environ.get("NOTIFY_ENVIRONMENT", "") in ["production", "staging", "scratch", "dev"] if on_aws: