mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
proxy protocol: added an option to make the proxy header required
now we can configure SFTPGo to accept or reject requests without the proxy header when the proxy protocol is enabled
This commit is contained in:
@@ -1709,3 +1709,18 @@ func TestSFTPExtensions(t *testing.T) {
|
||||
}
|
||||
sftpExtensions = initialSFTPExtensions
|
||||
}
|
||||
|
||||
func TestProxyProtocolVersion(t *testing.T) {
|
||||
c := Configuration{
|
||||
ProxyProtocol: 1,
|
||||
}
|
||||
proxyListener := c.getProxyListener(nil)
|
||||
if proxyListener.Policy != nil {
|
||||
t.Error("proxy listener policy must be nil")
|
||||
}
|
||||
c.ProxyProtocol = 2
|
||||
proxyListener = c.getProxyListener(nil)
|
||||
if proxyListener.Policy == nil {
|
||||
t.Error("proxy listener policy must be not nil")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user