MCPcopy Create free account
hub / github.com/kataras/iris / hostFilter

Function hostFilter

apps/switch_hosts.go:118–123  ·  view source on GitHub ↗
(expr string)

Source from the content-addressed store, hash-verified

116}
117
118func hostFilter(expr string) iris.Filter {
119 regex := regexp.MustCompile(expr)
120 return func(ctx iris.Context) bool {
121 return regex.MatchString(ctx.Host())
122 }
123}
124
125// HostsRedirectCode is the default status code is used
126// to redirect a matching host to a url.

Callers 2

GetSwitchCasesMethod · 0.85
TestSwitchJoinFunction · 0.85

Calls 2

MatchStringMethod · 0.80
HostMethod · 0.80

Tested by 1

TestSwitchJoinFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…