mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-11-03 19:17:29 -05:00 
			
		
		
		
	Tweak some comments
This commit is contained in:
		
							parent
							
								
									1426c97da5
								
							
						
					
					
						commit
						9206e8a738
					
				@ -170,9 +170,10 @@ func (rr *responseRecorder) WriteHeader(statusCode int) {
 | 
				
			|||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// save statusCode in case http middleware upgrading websocket
 | 
						// save statusCode always, in case HTTP middleware upgrades websocket
 | 
				
			||||||
	// connections by manually setting headers and writing status 101
 | 
						// connections by manually setting headers and writing status 101
 | 
				
			||||||
	rr.statusCode = statusCode
 | 
						rr.statusCode = statusCode
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// 1xx responses aren't final; just informational
 | 
						// 1xx responses aren't final; just informational
 | 
				
			||||||
	if statusCode < 100 || statusCode > 199 {
 | 
						if statusCode < 100 || statusCode > 199 {
 | 
				
			||||||
		rr.wroteHeader = true
 | 
							rr.wroteHeader = true
 | 
				
			||||||
 | 
				
			|||||||
@ -239,7 +239,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
 | 
				
			|||||||
				return
 | 
									return
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			repl.Set("http.response.status", wrec.Status())
 | 
								repl.Set("http.response.status", wrec.Status()) // will be 0 if no response is written by us (Go will write 200 to client)
 | 
				
			||||||
			repl.Set("http.response.size", wrec.Size())
 | 
								repl.Set("http.response.size", wrec.Size())
 | 
				
			||||||
			repl.Set("http.response.duration", duration)
 | 
								repl.Set("http.response.duration", duration)
 | 
				
			||||||
			repl.Set("http.response.duration_ms", duration.Seconds()*1e3) // multiply seconds to preserve decimal (see #4666)
 | 
								repl.Set("http.response.duration_ms", duration.Seconds()*1e3) // multiply seconds to preserve decimal (see #4666)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user