MCPcopy Index your code
hub / github.com/kataras/iris / WithRemoteAddrHeader

Function WithRemoteAddrHeader

configuration.go:409–424  ·  view source on GitHub ↗

WithRemoteAddrHeader adds a new request header name that can be used to validate the client's real IP.

(header ...string)

Source from the content-addressed store, hash-verified

407// WithRemoteAddrHeader adds a new request header name
408// that can be used to validate the client's real IP.
409func WithRemoteAddrHeader(header ...string) Configurator {
410 return func(app *Application) {
411 for _, h := range header {
412 exists := false
413 for _, v := range app.config.RemoteAddrHeaders {
414 if v == h {
415 exists = true
416 }
417 }
418
419 if !exists {
420 app.config.RemoteAddrHeaders = append(app.config.RemoteAddrHeaders, h)
421 }
422 }
423 }
424}
425
426// WithoutRemoteAddrHeader removes an existing request header name
427// that can be used to validate and parse the client's real IP.

Callers 1

BuildMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…