Fix wrong attribute to find remote address
The webob.Request class does not have the remote_address attribute but the remote_addr attribute. This change fixes usage of the non-existing attribute accordingly. Closes-Bug: #1967683 Change-Id: I5b9276b39b3ff314e3cd684202a40c2687ac0bdb
This commit is contained in:
parent
a351c3ac51
commit
e9904eafb1
@ -137,7 +137,7 @@ class NoAuthMiddleware(base_wsgi.Middleware):
|
||||
token = req.headers['X-Auth-Token']
|
||||
user_id, _sep, project_id = token.partition(':')
|
||||
project_id = project_id or user_id
|
||||
remote_address = getattr(req, 'remote_address', '127.0.0.1')
|
||||
remote_address = getattr(req, 'remote_addr', '127.0.0.1')
|
||||
if CONF.use_forwarded_for:
|
||||
remote_address = req.headers.get('X-Forwarded-For', remote_address)
|
||||
ctx = context.RequestContext(user_id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user