Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#4584·go-github

http.Client.Timeout is ignored by redirect-aware requests

Author: sb123sb123Created Sep 21, 2026Updated Sep 21, 2026

Bug

Requests made through the redirect-aware endpoint helpers do not honor the timeout configured on the client's http.Client.

roundTripWithOptionalFollowRedirect calls the configured transport directly. That preserves the ability to inspect 301/302 responses, but bypasses http.Client.Do, which is where http.Client.Timeout is applied. This affects helpers such as workflow log downloads, artifact downloads, archive links, and other callers of that helper when WithHTTPClient or WithTimeout is used.

Reproduction

Use a custom RoundTripper that waits for req.Context().Done() and a client timeout of 10 ms. On current master, the helper invokes the transport with the caller context and waits for the transport's full delay instead of returning a deadline error. The same request through the client's no-redirect http.Client returns context deadline exceeded at the configured timeout.

Expected behavior

Redirect-aware requests should preserve the existing no-follow behavior for the first response while honoring the configured HTTP client timeout.

Source: google/go-github

View original on GitHubView discussion on GitHub