server: Populate Request.Host field
This commit is contained in:
parent
fadb2aed97
commit
15f3e764c5
@ -23,7 +23,9 @@ type Request struct {
|
|||||||
// For international domain names, Host may be in Punycode or
|
// For international domain names, Host may be in Punycode or
|
||||||
// Unicode form. Use golang.org/x/net/idna to convert it to
|
// Unicode form. Use golang.org/x/net/idna to convert it to
|
||||||
// either format if needed.
|
// either format if needed.
|
||||||
// This field is ignored by the Gemini server.
|
//
|
||||||
|
// For server requests, Host specifies the host on which the URL
|
||||||
|
// is sought.
|
||||||
Host string
|
Host string
|
||||||
|
|
||||||
// For client requests, Certificate optionally specifies the
|
// For client requests, Certificate optionally specifies the
|
||||||
|
@ -291,6 +291,7 @@ func (srv *Server) respond(conn net.Conn) {
|
|||||||
if tlsConn, ok := conn.(*tls.Conn); ok {
|
if tlsConn, ok := conn.(*tls.Conn); ok {
|
||||||
state := tlsConn.ConnectionState()
|
state := tlsConn.ConnectionState()
|
||||||
req.TLS = &state
|
req.TLS = &state
|
||||||
|
req.Host = state.ServerName
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store remote address
|
// Store remote address
|
||||||
|
Loading…
Reference in New Issue
Block a user