Have NAS store IP addresses in NAS_LOGINS table

This commit is contained in:
Kyle Warwick-Mathieu
2015-05-02 22:02:53 -04:00
parent 80c917a8b5
commit 2ee0d821a3

View File

@@ -88,6 +88,7 @@ class NasHTTPServerHandler(BaseHTTPServer.BaseHTTPRequestHandler):
post = self.str_to_dict(self.rfile.read(length))
if self.client_address[0] == '127.0.0.1':
client_address = (self.headers.get('x-forwarded-for', self.client_address[0]), self.client_address[1])
post['ipaddr'] = client_address[0]
else:
client_address = self.client_address