From 585d724564344b6a968f3fce24eab217ed0fe47d Mon Sep 17 00:00:00 2001 From: James Taylor Date: Mon, 8 Mar 2021 21:33:23 -0800 Subject: Add hidden setting to allow foreign post requests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See #55 Signed-off-by: Jesús --- server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'server.py') diff --git a/server.py b/server.py index 649de38..09a0a54 100644 --- a/server.py +++ b/server.py @@ -204,7 +204,9 @@ def site_dispatch(env, start_response): method = env['REQUEST_METHOD'] path = env['PATH_INFO'] - if method == "POST" and client_address not in ('127.0.0.1', '::1'): + if (method == "POST" + and client_address not in ('127.0.0.1', '::1') + and not settings.allow_foreign_post_requests): yield error_code('403 Forbidden', start_response) return -- cgit v1.2.3