From a4d70262aadfa10eb668de6702d7ffcb2c020c2e Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Sat, 24 Sep 2016 12:09:28 -0600 Subject: [PATCH] Use strings.Contains instead of IndexOf for readability --- caddyhttp/httpserver/replacer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caddyhttp/httpserver/replacer.go b/caddyhttp/httpserver/replacer.go index b31011a92..72487dab1 100644 --- a/caddyhttp/httpserver/replacer.go +++ b/caddyhttp/httpserver/replacer.go @@ -111,7 +111,7 @@ func canLogRequest(r *http.Request) bool { if r.Method == "POST" || r.Method == "PUT" { for _, cType := range r.Header[headerContentType] { // the cType could have charset and other info - if strings.Index(cType, contentTypeJSON) > -1 || strings.Index(cType, contentTypeXML) > -1 { + if strings.Contains(cType, contentTypeJSON) || strings.Contains(cType, contentTypeXML) { return true } }