Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add timeouts when default client is in use
Go's default client has no timeouts and relies on the kernel timeouts, which goes against the recommended practice of setting timeouts at application-level whenever possible. This change ensures that if the default client is used, it is used with proper timeouts for TCP handshake, TLS handshake and HTTP request-response lifecycle. There is no emperical data for the value of 10 seconds. It is a good starting point and a sane default. Users are encouraged to create their own http.Client and many users already do so to control TLSConfig.
- Loading branch information