mirror of
https://github.com/tailscale/tailscale.git
synced 2026-09-13 06:19:11 -04:00
tsnet: base HTTPClient's transport on http.DefaultTransport
Previously Server.HTTPClient returned a client whose transport set only DialContext, losing http.DefaultTransport's defaults such as ForceAttemptHTTP2, MaxIdleConns, IdleConnTimeout, TLSHandshakeTimeout, and ExpectContinueTimeout. Now it clones http.DefaultTransport and overrides DialContext to dial over the tailnet, so it picks up those settings and any future defaults. Proxy is explicitly nil: an HTTP proxy from the environment would be dialed through the tailnet, where it's unlikely to be reachable. The new test compares the transport field by field against a clone of http.DefaultTransport and fails on any unknown future field, forcing a decision about how HTTPClient should handle it. Updates tailscale/corp#47393 (as motivation) Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com> Change-Id: I1e800982ee11d386699dd4f588c1fd2ce392f229
This commit is contained in:
500 Internal Server Error
Gitea Version: 1.28.0+dev-477-g8b6ad49a5f