summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/matchers.go
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-05-07 09:56:13 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2019-05-07 09:56:18 -0600
commite40bbecb16d196d2d700a9484e53c11b64dfe8d9 (patch)
treec4ab6cce5c98fdec6d9d5a3eaf666d5bea55a25f /modules/caddyhttp/matchers.go
parent8eba582efe2ec8646447d8721a42c486363b3bc2 (diff)
Rough implementation of auto HTTP->HTTPS redirects
Also added GracePeriod for server shutdowns
Diffstat (limited to 'modules/caddyhttp/matchers.go')
-rw-r--r--modules/caddyhttp/matchers.go12
1 files changed, 3 insertions, 9 deletions
diff --git a/modules/caddyhttp/matchers.go b/modules/caddyhttp/matchers.go
index 731832b..7336a1b 100644
--- a/modules/caddyhttp/matchers.go
+++ b/modules/caddyhttp/matchers.go
@@ -68,17 +68,11 @@ func (m matchScript) Match(r *http.Request) bool {
func (m matchProtocol) Match(r *http.Request) bool {
switch string(m) {
case "grpc":
- if r.Header.Get("content-type") == "application/grpc" {
- return true
- }
+ return r.Header.Get("content-type") == "application/grpc"
case "https":
- if r.TLS != nil {
- return true
- }
+ return r.TLS != nil
case "http":
- if r.TLS == nil {
- return true
- }
+ return r.TLS == nil
}
return false