Add proxy protocol support for X-Forwarded-Port

Fixes https://github.com/kubernetes/ingress-nginx/issues/4951
This commit is contained in:
Boris Djurdjevic 2020-01-24 13:50:35 +01:00
parent 12aa72622a
commit 665f924e9e
3 changed files with 7 additions and 2 deletions

View file

@ -68,7 +68,7 @@ var _ = framework.IngressNginxDescribe("Proxy Protocol", func() {
Expect(err).NotTo(HaveOccurred(), "unexpected error reading connection data")
body := string(data)
Expect(body).Should(ContainSubstring(fmt.Sprintf("host=%v", "proxy-protocol")))
Expect(body).Should(ContainSubstring(fmt.Sprintf("x-forwarded-port=80")))
Expect(body).Should(ContainSubstring(fmt.Sprintf("x-forwarded-port=1234")))
Expect(body).Should(ContainSubstring(fmt.Sprintf("x-forwarded-for=192.168.0.1")))
})
})