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

Function GetScheme

context/context.go:942–954  ·  view source on GitHub ↗

GetScheme returns the full scheme of the request URL (https://, http:// or ws:// and e.t.c.).

(r *http.Request)

Source from the content-addressed store, hash-verified

940
941// GetScheme returns the full scheme of the request URL (https://, http:// or ws:// and e.t.c.).
942func GetScheme(r *http.Request) string {
943 scheme := r.URL.Scheme
944
945 if scheme == "" {
946 if r.TLS != nil {
947 scheme = netutil.SchemeHTTPS
948 } else {
949 scheme = netutil.SchemeHTTP
950 }
951 }
952
953 return scheme + sufscheme
954}
955
956// Scheme returns the full scheme of the request (including :// suffix).
957func (ctx *Context) Scheme() string {

Callers 3

RewriteMethod · 0.92
WrapperMethod · 0.92
SchemeMethod · 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…