mirror of https://github.com/zulip/zulip.git
middleware: Stop using X_REAL_IP.
The comment was wrong, in that REMOTE_ADDR is where the real external IP was; X_REAL_IP was the loadbalancer's IP.
This commit is contained in:
parent
e2e0039ffe
commit
a702894e0e
|
@ -276,9 +276,6 @@ class LogRequests(MiddlewareMixin):
|
|||
# intends to block, so we stop here to avoid unnecessary work.
|
||||
return response
|
||||
|
||||
# The reverse proxy might have sent us the real external IP
|
||||
remote_ip = request.META.get('HTTP_X_REAL_IP')
|
||||
if remote_ip is None:
|
||||
remote_ip = request.META['REMOTE_ADDR']
|
||||
|
||||
# Get the requestor's identifier and client, if available.
|
||||
|
|
|
@ -113,8 +113,6 @@ def report_error(request: HttpRequest, user_profile: UserProfile, message: str=R
|
|||
version = None
|
||||
|
||||
# Get the IP address of the request
|
||||
remote_ip = request.META.get('HTTP_X_REAL_IP')
|
||||
if remote_ip is None:
|
||||
remote_ip = request.META['REMOTE_ADDR']
|
||||
|
||||
# For the privacy of our users, we remove any actual text content
|
||||
|
|
Loading…
Reference in New Issue