Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#4,584 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
go
Domain
api

Research direction

Start with roundTripWithOptionalFollowRedirect and trace how redirect-aware helpers obtain and invoke the configured http.Client or transport. Reproduce the issue with a custom RoundTripper that waits on req.Context().Done() and a 10 ms client timeout. Done means the first redirect response remains inspectable while requests through WithHTTPClient or WithTimeout return at the configured deadline.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Go
Stars
11.3k
Forks
2.5k
Avg merge
1d 2h
Merged PRs (30d)
41

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from google/go-github

All issues in google/go-github

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.