NewWithTimeout returns a hardened client with an overall Timeout. Use for simple request/response calls; for streaming, use New with a context deadline.
(timeout time.Duration, opts ...Option)
| 173 | // NewWithTimeout returns a hardened client with an overall Timeout. Use for |
| 174 | // simple request/response calls; for streaming, use New with a context deadline. |
| 175 | func NewWithTimeout(timeout time.Duration, opts ...Option) *http.Client { |
| 176 | return New(append([]Option{WithTimeout(timeout)}, opts...)...) |
| 177 | } |
| 178 | |
| 179 | // Harden applies the default hardening (refuse redirects, TLS 1.2 floor) to an |
| 180 | // existing client in place, for the cases where a third-party library hands us |
no test coverage detected