Add hidden setting to allow foreign post requests
See #55 Signed-off-by: Jesús <heckyel@hyperbola.info>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user