aboutsummaryrefslogtreecommitdiff
path: root/request.go
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-02-27 14:02:30 -0500
committerAdnan Maolood <[email protected]>2021-02-27 14:02:30 -0500
commit82bdffc1ebac233079aae388f7b7062368a2819e (patch)
treef75bec145ea12f2c3fe6722dde0ea36c4c996cee /request.go
parentrequest: Cache calls to TLS (diff)
downloadgo-gemini-82bdffc1ebac233079aae388f7b7062368a2819e.tar.xz
go-gemini-82bdffc1ebac233079aae388f7b7062368a2819e.zip
request: Add ServerName helper method
Diffstat (limited to 'request.go')
-rw-r--r--request.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/request.go b/request.go
index 59dd004..eaee287 100644
--- a/request.go
+++ b/request.go
@@ -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 ""
+}