mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-11-04 03:27:23 -05:00 
			
		
		
		
	fastcgi: use bytes.Contains and strconv.Itoa (#1857)
This commit is contained in:
		
							parent
							
								
									10484cfad2
								
							
						
					
					
						commit
						a59bdd08ca
					
				@ -155,7 +155,7 @@ func sendFcgi(reqType int, fcgiParams map[string]string, data []byte, posts map[
 | 
				
			|||||||
	fcgi.Close()
 | 
						fcgi.Close()
 | 
				
			||||||
	time.Sleep(1 * time.Second)
 | 
						time.Sleep(1 * time.Second)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if bytes.Index(content, []byte("FAILED")) >= 0 {
 | 
						if bytes.Contains(content, []byte("FAILED")) {
 | 
				
			||||||
		globalt.Error("Server return failed message")
 | 
							globalt.Error("Server return failed message")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -94,7 +94,7 @@ func (t Templates) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error
 | 
				
			|||||||
		rb.CopyHeader()
 | 
							rb.CopyHeader()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// set the actual content length now that the template was executed
 | 
							// set the actual content length now that the template was executed
 | 
				
			||||||
		w.Header().Set("Content-Length", strconv.FormatInt(int64(buf.Len()), 10))
 | 
							w.Header().Set("Content-Length", strconv.Itoa(buf.Len()))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// get the modification time in preparation to ServeContent
 | 
							// get the modification time in preparation to ServeContent
 | 
				
			||||||
		modTime, _ := time.Parse(http.TimeFormat, w.Header().Get("Last-Modified"))
 | 
							modTime, _ := time.Parse(http.TimeFormat, w.Header().Get("Last-Modified"))
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user