go test -run Test_Ctx_Hostname_Trusted
(t *testing.T)
| 3128 | |
| 3129 | // go test -run Test_Ctx_Hostname_Trusted |
| 3130 | func Test_Ctx_Hostname_TrustedProxy(t *testing.T) { |
| 3131 | t.Parallel() |
| 3132 | { |
| 3133 | app := New(Config{ |
| 3134 | TrustProxy: true, |
| 3135 | TrustProxyConfig: TrustProxyConfig{Proxies: []string{"0.0.0.0", "0.8.0.1"}}, |
| 3136 | }) |
| 3137 | c := app.AcquireCtx(&fasthttp.RequestCtx{}) |
| 3138 | c.Request().SetRequestURI("http://google.com/test") |
| 3139 | c.Request().Header.Set(HeaderXForwardedHost, "google1.com") |
| 3140 | require.Equal(t, "google1.com", c.Hostname()) |
| 3141 | app.ReleaseCtx(c) |
| 3142 | } |
| 3143 | } |
| 3144 | |
| 3145 | // go test -run Test_Ctx_Hostname_Trusted_Multiple |
| 3146 | func Test_Ctx_Hostname_TrustedProxy_Multiple(t *testing.T) { |
nothing calls this directly
no test coverage detected