IsSSL reports whether the client is running under HTTPS SSL. See `IsHTTP2` too.
()
| 1212 | // |
| 1213 | // See `IsHTTP2` too. |
| 1214 | func (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. |
no test coverage detected