Skip to content

Commit

Permalink
revert to last good
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Kehl committed Feb 3, 2025
1 parent 9933db8 commit 0226c07
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions gunicorn_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,21 @@ def worker_int(worker):
worker.log.info("worker: received SIGINT {}".format(worker.pid))


def post_request(worker, req, environ, resp):
if "Server" in resp.headers:
resp.headers.pop("Server")
# fix dynamic scan warning 10036
def post_fork(server, worker):
server.cfg.set(
"secure_scheme_headers",
{
"X-FORWARDED-PROTO": "https",
},
)
original_send = worker.wsgi.send

def custom_send(self, resp, *args, **kwargs):
resp.headers.pop("Server", None)
return original_send(resp, *args, **kwargs)

worker.wsgi.send = custom_send.__get__(worker.wsgi, type(worker.wsgi))


def fix_ssl_monkeypatching():
Expand Down

0 comments on commit 0226c07

Please sign in to comment.