http: reimplement X-Forwarded-For parsing (#4355)

This feature needs to be enabled through the `http.use_x_forwarded_for` option,
satisfying security concerns of spoofed remote addresses in untrusted network
environments.

The testsuite was enhanced to explicitly test the functionality of the
header.

Fixes #4265.

Signed-off-by: Martin Weinelt <hexa@darmstadt.ccc.de>
This commit is contained in:
hexa- authored and Paulus Schoutsen committed 2016-11-12 16:14:39 -08:00
1 parent 3d47ad5018
commit e73634e6c7
5 files changed
+47 -13

No files matched your search

+2 -1
View File
@@ -165,7 +165,8 @@ class TestCheckConfig(unittest.TestCase):
self.assertDictEqual({
'components': {'http': {'api_password': 'abc123',
'server_port': 8123}},
'server_port': 8123,
'use_x_forwarded_for': False}},
'except': {},
'secret_cache': {secrets_path: {'http_pw': 'abc123'}},
'secrets': {'http_pw': 'abc123'},