From 90148c9ab53c53019055d8ca54ffcbba08b2b284 Mon Sep 17 00:00:00 2001 From: Bert JW Regeer Date: Thu, 26 Nov 2020 21:41:06 -0800 Subject: Add new adjustment named server_name --- src/waitress/adjustments.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/waitress/adjustments.py b/src/waitress/adjustments.py index 42d2bc0..466b5c4 100644 --- a/src/waitress/adjustments.py +++ b/src/waitress/adjustments.py @@ -136,6 +136,7 @@ class Adjustments: ("unix_socket_perms", asoctal), ("sockets", as_socket_list), ("channel_request_lookahead", int), + ("server_name", str), ) _param_map = dict(_params) @@ -288,6 +289,11 @@ class Adjustments: # is being processed. channel_request_lookahead = 0 + # This setting controls the SERVER_NAME of the WSGI environment, this is + # only ever used if the remote client sent a request without a Host header + # (or when using the Proxy settings, without forwarding a Host header) + server_name = "waitress.invalid" + def __init__(self, **kw): if "listen" in kw and ("host" in kw or "port" in kw): -- cgit v1.2.1