HTTPVersion reports the HTTP version in use, such as "HTTP/1.1" or "HTTP/2.0".
(ctx context.Context)
| 1018 | |
| 1019 | // HTTPVersion reports the HTTP version in use, such as "HTTP/1.1" or "HTTP/2.0". |
| 1020 | func (c *Client) HTTPVersion(ctx context.Context) (string, error) { |
| 1021 | req := c.newRequest(ctx, "HEAD", c.discoRoot(), nil) |
| 1022 | res, err := c.doReqGated(req) |
| 1023 | if err != nil { |
| 1024 | return "", err |
| 1025 | } |
| 1026 | return res.Proto, err |
| 1027 | } |
| 1028 | |
| 1029 | func (c *Client) discoveryResp(ctx context.Context) (*http.Response, error) { |
| 1030 | // If the path is just "" or "/", do discovery against |
no test coverage detected