Skip to content

fix: preserve digest auth on HTTP/2 fallback, apply dialer opts, and format doc.go - #606

Closed
TassioSales wants to merge 1 commit into
projectdiscovery:mainfrom
TassioSales:fix/dialer-cache-and-doc-fmt
Closed

TassioSales wants to merge 1 commit into
projectdiscovery:mainfrom
TassioSales:fix/dialer-cache-and-doc-fmt

Conversation

@TassioSales

Copy link
Copy Markdown

Fixes #601
Fixes #602
Fixes #603

Summary

This PR addresses three fixes across retryablehttp-go:

  1. Preserve Digest Auth on HTTP/2 Fallback (HTTP/2 fallback drops digest auth #601): When a request configured with DigestAuth triggered the HTTP/2 fallback in Do, the retry was executed directly via HTTPClient2.Do(req.Request) without wrapping in dac.Transport, stripping authorization headers and returning 401 Unauthorized. It is now properly wrapped in dac.NewTransport using HTTPClient2.
  2. Apply FastDialer CacheType Override (getFastDialer ignores its CacheType override #602): getFastDialer set opts.CacheType = fastdialer.Memory on opts, but passed fastdialer.DefaultOptions instead of opts to fastdialer.NewDialer. It now correctly passes opts.
  3. Format doc.go (doc.go is not gofmt-formatted #603): Added the missing trailing newline to doc.go so gofmt -l . succeeds cleanly.

Testing

  • Added unit test TestDoHTTP2FallbackPreservesDigestAuth in do_http2_fallback_test.go verifying that HTTP/2 fallback preserves digest credentials and succeeds.
  • Verified all tests pass with go test -v ./....
  • Verified gofmt -l doc.go returns no formatting diffs.

…format doc.go

- Wrap HTTPClient2 request with digest transport when DigestAuth is configured (fixes projectdiscovery#601)
- Pass configured opts to fastdialer.NewDialer in getFastDialer (fixes projectdiscovery#602)
- Add missing trailing newline to doc.go (fixes projectdiscovery#603)
- Add unit test TestDoHTTP2FallbackPreservesDigestAuth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doc.go is not gofmt-formatted getFastDialer ignores its CacheType override HTTP/2 fallback drops digest auth

2 participants