mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-11-04 03:27:23 -05:00 
			
		
		
		
	Use strings.Contains instead of IndexOf for readability
This commit is contained in:
		
							parent
							
								
									bac54de9eb
								
							
						
					
					
						commit
						a4d70262aa
					
				@ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user