fix werkzeug server header

This commit is contained in:
Kenneth Kehl
2025-02-04 07:39:42 -08:00
parent dea1ef5eae
commit f3d7d56e04
2 changed files with 1 additions and 16 deletions

View File

@@ -81,21 +81,6 @@ class ResponseHeaderMiddleware(object):
for key, value in headers
if key.lower() not in ["server", "last-modified"]
]
found_a_text_yaml = False
old_headers_len = len(headers)
headers = [
(key, value)
for key, value in headers
if "text/yaml" not in value.lower()
]
new_headers_len = len(headers)
if new_headers_len < old_headers_len:
found_a_text_yaml = True
if found_a_text_yaml:
headers.append(("Content-Type", "text/plain"))
print(f"MIDDLEWARE HEADERS {headers}")
return start_response(status, headers, exc_info)
return self._app(environ, rewrite_response_headers)

View File

@@ -4,4 +4,4 @@ if [[ $CF_INSTANCE_INDEX -eq 0 ]]; then
flask db upgrade
fi
exec newrelic-admin run-program gunicorn -c ${HOME}/gunicorn_config.py --no-sendfile application
exec newrelic-admin run-program gunicorn -c ${HOME}/gunicorn_config.py application