From 2f52fe974b71baa55f80b0d1e520b05e63d34d44 Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Wed, 6 Nov 2013 12:06:54 +0530 Subject: [PATCH] [minor] fix ip restrictions to use forwarded for header as well --- webnotes/auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webnotes/auth.py b/webnotes/auth.py index 66c912afaf..fdc9baff6a 100644 --- a/webnotes/auth.py +++ b/webnotes/auth.py @@ -171,7 +171,7 @@ class LoginManager: ip_list = [i.strip() for i in ip_list] for ip in ip_list: - if webnotes.get_request_header('REMOTE_ADDR', '').startswith(ip): + if webnotes.get_request_header('REMOTE_ADDR', '').startswith(ip) or webnotes.get_request_header('HTTP_X_FORWARDED_FOR', '').startswith(ip): return webnotes.msgprint('Not allowed from this IP Address')