server: Make Request.RemoteAddr a string

This commit is contained in:
Adnan Maolood 2021-02-20 13:31:55 -05:00
parent 0ab236c736
commit a7f958b20d
2 changed files with 2 additions and 3 deletions

View File

@ -5,7 +5,6 @@ import (
"context" "context"
"crypto/tls" "crypto/tls"
"io" "io"
"net"
"net/url" "net/url"
) )
@ -39,7 +38,7 @@ type Request struct {
// sets RemoteAddr to an "IP:port" address before invoking a // sets RemoteAddr to an "IP:port" address before invoking a
// handler. // handler.
// This field is ignored by the Gemini client. // This field is ignored by the Gemini client.
RemoteAddr net.Addr RemoteAddr string
// TLS allows Gemini servers and other software to record // TLS allows Gemini servers and other software to record
// information about the TLS connection on which the request // information about the TLS connection on which the request

View File

@ -294,7 +294,7 @@ func (srv *Server) respond(conn net.Conn) {
} }
// Store remote address // Store remote address
req.RemoteAddr = conn.RemoteAddr() req.RemoteAddr = conn.RemoteAddr().String()
h := srv.Handler h := srv.Handler
if h == nil { if h == nil {