httpd/webdav: allow to configure trusted proxy header and depth

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2022-05-28 19:47:23 +02:00
parent 32da923dfe
commit f6b11c2d01
11 changed files with 173 additions and 72 deletions

View File

@@ -1551,11 +1551,12 @@ func TestProxyHeaders(t *testing.T) {
testIP := "10.29.1.9"
validForwardedFor := "172.19.2.6"
b := Binding{
Address: "",
Port: 8080,
EnableWebAdmin: true,
EnableWebClient: false,
ProxyAllowed: []string{testIP, "10.8.0.0/30"},
Address: "",
Port: 8080,
EnableWebAdmin: true,
EnableWebClient: false,
ProxyAllowed: []string{testIP, "10.8.0.0/30"},
ClientIPProxyHeader: "x-forwarded-for",
}
err = b.parseAllowedProxy()
assert.NoError(t, err)