mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-06 02:48:48 +03:00
Use strings.Contains instead of IndexOf for readability
This commit is contained in:
parent
bac54de9eb
commit
a4d70262aa
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue