mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
parse IP proxy header also if listening on UNIX domain socket
Fixes #867 Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -412,6 +412,18 @@ func TestUserInvalidParams(t *testing.T) {
|
||||
writeLog(req, http.StatusOK, nil)
|
||||
}
|
||||
|
||||
func TestAllowedProxyUnixDomainSocket(t *testing.T) {
|
||||
b := Binding{
|
||||
Address: filepath.Join(os.TempDir(), "sock"),
|
||||
ProxyAllowed: []string{"127.0.0.1", "127.0.1.1"},
|
||||
}
|
||||
err := b.parseAllowedProxy()
|
||||
assert.NoError(t, err)
|
||||
if assert.Len(t, b.allowHeadersFrom, 1) {
|
||||
assert.True(t, b.allowHeadersFrom[0](nil))
|
||||
}
|
||||
}
|
||||
|
||||
func TestRemoteAddress(t *testing.T) {
|
||||
remoteAddr1 := "100.100.100.100"
|
||||
remoteAddr2 := "172.172.172.172"
|
||||
|
||||
Reference in New Issue
Block a user