aboutsummaryrefslogtreecommitdiff
path: root/request.go
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-02-28 21:59:17 -0500
committerAdnan Maolood <[email protected]>2021-02-28 21:59:19 -0500
commitad5d78f08f5bce15eca678fe53949a414ae7c620 (patch)
treebeb12bf459a4f14149a6c21edd24ec123f498f26 /request.go
parentRemove Request.RemoteAddr helper method (diff)
downloadgo-gemini-ad5d78f08f5bce15eca678fe53949a414ae7c620.tar.xz
go-gemini-ad5d78f08f5bce15eca678fe53949a414ae7c620.zip
Mention that Request methods don't work for clients
Diffstat (limited to 'request.go')
-rw-r--r--request.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/request.go b/request.go
index eaee287..b022a31 100644
--- a/request.go
+++ b/request.go
@@ -95,12 +95,14 @@ func (r *Request) Write(w io.Writer) error {
}
// Conn returns the network connection on which the request was received.
+// Conn returns nil for client requests.
func (r *Request) Conn() net.Conn {
return r.conn
}
// TLS returns information about the TLS connection on which the
// request was received.
+// TLS returns nil for client requests.
func (r *Request) TLS() *tls.ConnectionState {
if r.tls == nil {
if tlsConn, ok := r.conn.(*tls.Conn); ok {
@@ -113,6 +115,7 @@ func (r *Request) TLS() *tls.ConnectionState {
// ServerName returns the value of the TLS Server Name Indication extension
// sent by the client.
+// ServerName returns an empty string for client requests.
func (r *Request) ServerName() string {
if tls := r.TLS(); tls != nil {
return tls.ServerName