mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-11-04 03:27:23 -05:00 
			
		
		
		
	templates: Fix httpInclude (fix #5698)
Allowable during feature freeze because this is a simple, non-invasive bug fix only.
This commit is contained in:
		
							parent
							
								
									a8cc5d1a7d
								
							
						
					
					
						commit
						431adc0980
					
				@ -245,12 +245,14 @@ type Server struct {
 | 
				
			|||||||
// ServeHTTP is the entry point for all HTTP requests.
 | 
					// ServeHTTP is the entry point for all HTTP requests.
 | 
				
			||||||
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
 | 
					func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
 | 
				
			||||||
	// If there are listener wrappers that process tls connections but don't return a *tls.Conn, this field will be nil.
 | 
						// If there are listener wrappers that process tls connections but don't return a *tls.Conn, this field will be nil.
 | 
				
			||||||
	// Can be removed if https://github.com/golang/go/pull/56110 is ever merged.
 | 
						// TODO: Can be removed if https://github.com/golang/go/pull/56110 is ever merged.
 | 
				
			||||||
	if r.TLS == nil {
 | 
						if r.TLS == nil {
 | 
				
			||||||
		conn := r.Context().Value(ConnCtxKey).(net.Conn)
 | 
							// not all requests have a conn (like virtual requests) - see #5698
 | 
				
			||||||
		if csc, ok := conn.(connectionStateConn); ok {
 | 
							if conn, ok := r.Context().Value(ConnCtxKey).(net.Conn); ok {
 | 
				
			||||||
			r.TLS = new(tls.ConnectionState)
 | 
								if csc, ok := conn.(connectionStateConn); ok {
 | 
				
			||||||
			*r.TLS = csc.ConnectionState()
 | 
									r.TLS = new(tls.ConnectionState)
 | 
				
			||||||
 | 
									*r.TLS = csc.ConnectionState()
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user