diff options
author | James Taylor <user234683@users.noreply.github.com> | 2021-03-08 21:33:23 -0800 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-03-15 22:25:08 -0500 |
commit | 585d724564344b6a968f3fce24eab217ed0fe47d (patch) | |
tree | 57de253b3514e5d82e7ad7297e47897160ebd7dd /server.py | |
parent | e549b5f67c4beff421a2b2b36f3b5031bfe8ed88 (diff) | |
download | yt-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.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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 |