1
0
mirror of https://git.sr.ht/~adnano/go-gemini synced 2024-11-23 16:52:06 +01:00

Store a reference to the Request in Response

This commit is contained in:
adnano 2020-10-28 00:21:27 -04:00
parent 80e2f783c3
commit b25fdec389
2 changed files with 4 additions and 0 deletions

@ -156,6 +156,7 @@ func (c *Client) do(req *Request, via []*Request) (*Response, error) {
}
}
resp.Request = req
return resp, nil
}

@ -21,6 +21,9 @@ type Response struct {
// Body contains the response body for successful responses.
Body io.ReadCloser
// Request is the request that was sent to obtain this Response.
Request *Request
// TLS contains information about the TLS connection on which the response
// was received.
TLS tls.ConnectionState