Commit a4d70262 authored by Matthew Holt's avatar Matthew Holt

Use strings.Contains instead of IndexOf for readability

parent bac54de9
...@@ -111,7 +111,7 @@ func canLogRequest(r *http.Request) bool { ...@@ -111,7 +111,7 @@ func canLogRequest(r *http.Request) bool {
if r.Method == "POST" || r.Method == "PUT" { if r.Method == "POST" || r.Method == "PUT" {
for _, cType := range r.Header[headerContentType] { for _, cType := range r.Header[headerContentType] {
// the cType could have charset and other info // 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 return true
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment