Only use the X-Forwarded-For header if connection is from a trusted network (#15182)

See https://github.com/home-assistant/home-assistant/issues/14345#issuecomment-400854569
This commit is contained in:
Colin O'Dell authored and Paulus Schoutsen committed 2018-06-28 09:16:11 -04:00
1 parent dbb786c548
commit 19f2bbf52f
4 files changed
+31 -10

No files matched your search

+1 -1
View File
@@ -180,7 +180,7 @@ class HomeAssistantHTTP(object):
middlewares=[staticresource_middleware])
# This order matters
setup_real_ip(app, use_x_forwarded_for)
setup_real_ip(app, use_x_forwarded_for, trusted_networks)
if is_ban_enabled:
setup_bans(hass, app, login_threshold)