From ccaa0ba3f16cb29039f0bccab1583951b8f5267c Mon Sep 17 00:00:00 2001 From: Jumana B Date: Tue, 7 Nov 2023 14:33:07 -0500 Subject: [PATCH] Remove server from response (#2017) * Remove server from response * fix typecheck --- gunicorn_config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gunicorn_config.py b/gunicorn_config.py index 665655e00a..e43a7cb288 100644 --- a/gunicorn_config.py +++ b/gunicorn_config.py @@ -2,6 +2,7 @@ import sys import traceback +import gunicorn # type: ignore 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: