1
0
mirror of https://git.sr.ht/~adnano/go-gemini synced 2024-09-28 15:21:23 +02:00

request: Add ServerName helper method

This commit is contained in:
Adnan Maolood 2021-02-27 14:02:30 -05:00
parent a396ec77e4
commit 82bdffc1eb

@ -110,3 +110,12 @@ func (r *Request) TLS() *tls.ConnectionState {
}
return r.tls
}
// ServerName returns the value of the TLS Server Name Indication extension
// sent by the client.
func (r *Request) ServerName() string {
if tls := r.TLS(); tls != nil {
return tls.ServerName
}
return ""
}