mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-09-19 06:31:47 +00:00
also use port number when checking https proxy for WebhookAuthenticator
This commit is contained in:
@@ -1068,7 +1068,10 @@ func TestController(t *testing.T) {
|
||||
fakeProxyDetect := fakeproxydetect.New(true, nil)
|
||||
t.Cleanup(func() {
|
||||
require.Equal(t, 1, fakeProxyDetect.NumberOfInvocations())
|
||||
require.Equal(t, "127.0.0.1", fakeProxyDetect.ReceivedHostDuringMostRecentInvocation())
|
||||
require.Equal(t,
|
||||
strings.TrimPrefix(goodWebhookAuthenticatorSpecWithCA.Endpoint, "https://"),
|
||||
fakeProxyDetect.ReceivedHostDuringMostRecentInvocation(),
|
||||
)
|
||||
})
|
||||
return fakeProxyDetect
|
||||
},
|
||||
@@ -1117,7 +1120,10 @@ func TestController(t *testing.T) {
|
||||
fakeProxyDetect := fakeproxydetect.New(false, nil)
|
||||
t.Cleanup(func() {
|
||||
require.Equal(t, 1, fakeProxyDetect.NumberOfInvocations())
|
||||
require.Equal(t, "127.0.0.1", fakeProxyDetect.ReceivedHostDuringMostRecentInvocation())
|
||||
require.Equal(t,
|
||||
strings.TrimPrefix(goodWebhookAuthenticatorSpecWithCA.Endpoint, "https://"),
|
||||
fakeProxyDetect.ReceivedHostDuringMostRecentInvocation(),
|
||||
)
|
||||
})
|
||||
return fakeProxyDetect
|
||||
},
|
||||
@@ -1160,7 +1166,10 @@ func TestController(t *testing.T) {
|
||||
fakeProxyDetect := fakeproxydetect.New(true, nil)
|
||||
t.Cleanup(func() {
|
||||
require.Equal(t, 1, fakeProxyDetect.NumberOfInvocations())
|
||||
require.Equal(t, "127.0.0.1", fakeProxyDetect.ReceivedHostDuringMostRecentInvocation())
|
||||
require.Equal(t,
|
||||
strings.TrimPrefix(goodWebhookAuthenticatorSpecWithCA.Endpoint, "https://"),
|
||||
fakeProxyDetect.ReceivedHostDuringMostRecentInvocation(),
|
||||
)
|
||||
})
|
||||
return fakeProxyDetect
|
||||
},
|
||||
@@ -1208,7 +1217,10 @@ func TestController(t *testing.T) {
|
||||
fakeProxyDetect := fakeproxydetect.New(false, errors.New("fake proxy detector error"))
|
||||
t.Cleanup(func() {
|
||||
require.Equal(t, 1, fakeProxyDetect.NumberOfInvocations())
|
||||
require.Equal(t, "127.0.0.1", fakeProxyDetect.ReceivedHostDuringMostRecentInvocation())
|
||||
require.Equal(t,
|
||||
strings.TrimPrefix(goodWebhookAuthenticatorSpecWithCA.Endpoint, "https://"),
|
||||
fakeProxyDetect.ReceivedHostDuringMostRecentInvocation(),
|
||||
)
|
||||
})
|
||||
return fakeProxyDetect
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user