MCPcopy Index your code
hub / github.com/coder/coder / RealIP

Function RealIP

coderd/httpmw/realip.go:235–241  ·  view source on GitHub ↗

FromContext retrieves the state from the given context.Context.

(ctx context.Context)

Source from the content-addressed store, hash-verified

233
234// FromContext retrieves the state from the given context.Context.
235func RealIP(ctx context.Context) *RealIPState {
236 state, ok := ctx.Value(ctxKey{}).(*RealIPState)
237 if !ok {
238 return nil
239 }
240 return state
241}
242
243// ParseRealIPConfig takes a raw string array of headers and origins
244// to produce a config.

Callers 2

EffectiveHostFunction · 0.85

Calls 1

ValueMethod · 0.45

Tested by

no test coverage detected