mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-05 18:18:25 -04:00
Merge pull request #1254 from alphagov/Inbound-sms-ip
fixing minor problem, logged ip variable name changed
This commit is contained in:
@@ -51,7 +51,6 @@ def restrict_ip_sms():
|
|||||||
current_app.logger.info("X-Custom-forwarder {}".format(request.headers.get("X-Custom-forwarder")))
|
current_app.logger.info("X-Custom-forwarder {}".format(request.headers.get("X-Custom-forwarder")))
|
||||||
|
|
||||||
# Check IP of SMS providers
|
# Check IP of SMS providers
|
||||||
ip = ''
|
|
||||||
if request.headers.get("X-Forwarded-For"):
|
if request.headers.get("X-Forwarded-For"):
|
||||||
# X-Forwarded-For looks like "203.0.113.195, 70.41.3.18, 150.172.238.178"
|
# X-Forwarded-For looks like "203.0.113.195, 70.41.3.18, 150.172.238.178"
|
||||||
# Counting backwards and look at the IP at the 3rd last hop - hence, hop(end-3)
|
# Counting backwards and look at the IP at the 3rd last hop - hence, hop(end-3)
|
||||||
@@ -80,7 +79,7 @@ def restrict_ip_sms():
|
|||||||
'message': 'Inbound sms ip address',
|
'message': 'Inbound sms ip address',
|
||||||
'log_contents': {
|
'log_contents': {
|
||||||
'passed': allowed,
|
'passed': allowed,
|
||||||
'ip_address': ip
|
'ip_address': inbound_ip
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user