from gunicorn.http import wsgi from functools import wraps def wrap_default_headers(func): @wraps(func) def default_headers(*args, **kwargs): return [h for h in func(*args, **kwargs) if not h.startswith('Server:')] return default_headers wsgi.Response.default_headers = wrap_default_headers(wsgi.Response.default_headers)