mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-24 12:08:19 +02:00
only enable http challenges on port 80
This commit is contained in:
parent
21a4fa6e29
commit
1e155ac3f4
2 changed files with 44 additions and 4 deletions
|
@ -630,3 +630,23 @@ func Test_configureTrustedRoots(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestShouldEnableHTTPChallenge(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
assert.False(t, shouldEnableHTTPChallenge(nil))
|
||||
assert.False(t, shouldEnableHTTPChallenge(&config.Config{}))
|
||||
assert.False(t, shouldEnableHTTPChallenge(&config.Config{Options: &config.Options{}}))
|
||||
assert.False(t, shouldEnableHTTPChallenge(&config.Config{Options: &config.Options{
|
||||
HTTPRedirectAddr: ":8080",
|
||||
}}))
|
||||
assert.False(t, shouldEnableHTTPChallenge(&config.Config{Options: &config.Options{
|
||||
HTTPRedirectAddr: "127.0.0.1:8080",
|
||||
}}))
|
||||
assert.True(t, shouldEnableHTTPChallenge(&config.Config{Options: &config.Options{
|
||||
HTTPRedirectAddr: ":80",
|
||||
}}))
|
||||
assert.True(t, shouldEnableHTTPChallenge(&config.Config{Options: &config.Options{
|
||||
HTTPRedirectAddr: "127.0.0.1:80",
|
||||
}}))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue