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

Method IsSSL

context/context.go:1214–1225  ·  view source on GitHub ↗

IsSSL reports whether the client is running under HTTPS SSL. See `IsHTTP2` too.

()

Source from the content-addressed store, hash-verified

1212//
1213// See `IsHTTP2` too.
1214func (ctx *Context) IsSSL() bool {
1215 ssl := strings.EqualFold(ctx.request.URL.Scheme, "https") || ctx.request.TLS != nil
1216 if !ssl {
1217 for k, v := range ctx.app.ConfigurationReadOnly().GetSSLProxyHeaders() {
1218 if ctx.GetHeader(k) == v {
1219 ssl = true
1220 break
1221 }
1222 }
1223 }
1224 return ssl
1225}
1226
1227// IsHTTP2 reports whether the protocol version for incoming request was HTTP/2.
1228// The client code always uses either HTTP/1.1 or HTTP/2.

Callers 1

trySetCookieMethod · 0.80

Calls 3

GetHeaderMethod · 0.95
GetSSLProxyHeadersMethod · 0.65
ConfigurationReadOnlyMethod · 0.65

Tested by

no test coverage detected