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

Function GetSubdomainFull

context/context.go:1035–1044  ·  view source on GitHub ↗

GetSubdomainFull returns the full subdomain level, e.g. [test.user.]mydomain.com.

(r *http.Request)

Source from the content-addressed store, hash-verified

1033// GetSubdomainFull returns the full subdomain level, e.g.
1034// [test.user.]mydomain.com.
1035func GetSubdomainFull(r *http.Request) string {
1036 host := GetHost(r) // host:port
1037 rootDomain := GetDomain(host) // mydomain.com
1038 rootDomainIdx := strings.Index(host, rootDomain)
1039 if rootDomainIdx == -1 {
1040 return ""
1041 }
1042
1043 return host[0:rootDomainIdx]
1044}
1045
1046// SubdomainFull returns the full subdomain level, e.g.
1047// [test.user.]mydomain.com.

Callers

nothing calls this directly

Calls 2

GetHostFunction · 0.85
IndexMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…