aboutsummaryrefslogtreecommitdiffstats
path: root/server.py
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2021-03-08 21:33:23 -0800
committerJesús <heckyel@hyperbola.info>2021-03-15 22:25:08 -0500
commit585d724564344b6a968f3fce24eab217ed0fe47d (patch)
tree57de253b3514e5d82e7ad7297e47897160ebd7dd /server.py
parente549b5f67c4beff421a2b2b36f3b5031bfe8ed88 (diff)
downloadyt-local-585d724564344b6a968f3fce24eab217ed0fe47d.tar.lz
yt-local-585d724564344b6a968f3fce24eab217ed0fe47d.tar.xz
yt-local-585d724564344b6a968f3fce24eab217ed0fe47d.zip
Add hidden setting to allow foreign post requests
See #55 Signed-off-by: Jesús <heckyel@hyperbola.info>
Diffstat (limited to 'server.py')
-rw-r--r--server.py4
1 files changed, 3 insertions, 1 deletions
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