11 lines
344 B
Python
11 lines
344 B
Python
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)
|