request: Add Conn and TLS methods
This commit is contained in:
11
server.go
11
server.go
@@ -366,16 +366,7 @@ func (srv *Server) serveConn(ctx context.Context, conn net.Conn) error {
|
||||
w.WriteHeader(StatusBadRequest, "Bad request")
|
||||
return w.Flush()
|
||||
}
|
||||
|
||||
// Store the TLS connection state
|
||||
if tlsConn, ok := conn.(*tls.Conn); ok {
|
||||
state := tlsConn.ConnectionState()
|
||||
req.TLS = &state
|
||||
req.Host = state.ServerName
|
||||
}
|
||||
|
||||
// Store remote address
|
||||
req.RemoteAddr = conn.RemoteAddr()
|
||||
req.conn = conn
|
||||
|
||||
h := srv.Handler
|
||||
if h == nil {
|
||||
|
||||
Reference in New Issue
Block a user