MCPcopy
hub / github.com/gofiber/fiber / Test_Ctx_Host

Function Test_Ctx_Host

ctx_test.go:2841–2848  ·  view source on GitHub ↗

go test -run Test_Ctx_Host

(t *testing.T)

Source from the content-addressed store, hash-verified

2839
2840// go test -run Test_Ctx_Host
2841func Test_Ctx_Host(t *testing.T) {
2842 t.Parallel()
2843 app := New()
2844 c := app.AcquireCtx(&fasthttp.RequestCtx{})
2845
2846 c.Request().SetRequestURI("http://google.com/test")
2847 require.Equal(t, "google.com", c.Host())
2848}
2849
2850// go test -run Test_Ctx_Host_UntrustedProxy
2851func Test_Ctx_Host_UntrustedProxy(t *testing.T) {

Callers

nothing calls this directly

Calls 4

AcquireCtxMethod · 0.80
NewFunction · 0.70
RequestMethod · 0.65
HostMethod · 0.65

Tested by

no test coverage detected