MCPcopy
hub / github.com/caddyserver/caddy / fakeRequest

Function fakeRequest

modules/caddyhttp/staticresp_test.go:60–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58}
59
60func fakeRequest() *http.Request {
61 r, _ := http.NewRequest("GET", "/", nil)
62 repl := caddy.NewReplacer()
63 ctx := context.WithValue(r.Context(), caddy.ReplacerCtxKey, repl)
64 r = r.WithContext(ctx)
65 return r
66}

Callers 1

Calls 1

WithValueMethod · 0.80

Tested by

no test coverage detected