Make is_local_addr accept localhost.

This is useful for minimal installs where the proxy lives on the same
host as the app.
This commit is contained in:
Neil Williams
2013-09-20 19:27:18 -07:00
parent d930799df3
commit c9013c4438

View File

@@ -42,7 +42,7 @@ logging.getLogger('scgi-wsgi').setLevel(logging.CRITICAL)
def is_local_address(ip):
# TODO: support the /20 and /24 private networks? make this configurable?
return ip.startswith('10.')
return ip.startswith('10.') or ip == "127.0.0.1"
def abort(code_or_exception=None, detail="", headers=None, comment=None,
**kwargs):