Conversation
WalkthroughA new package-level variable was added to store a list of HTTP response headers relevant to rate limiting and retry information. The HTTP transport logic was updated so that, when logging is enabled and a response is received, the values of these headers are extracted from the response and included in the log output. This change enhances the detail of HTTP request logs by systematically capturing important rate limit and retry headers from responses. Changes
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
pkg/uhttp/transport.go (1)
161-169: Good implementation for capturing header valuesThe code efficiently collects and logs only the headers that are present in the response. One small optimization could be to initialize the map with
len(loggedResponseHeaders)instead oflen(resp.Header)since you'll only be storing a subset of headers.- headers := make(map[string][]string, len(resp.Header)) + headers := make(map[string][]string, len(loggedResponseHeaders))
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
pkg/uhttp/transport.go(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: go-test (1.23.x, windows-latest)
🔇 Additional comments (1)
pkg/uhttp/transport.go (1)
18-37: Well-organized list of rate limit headers!Good job documenting the purpose of each header group and including non-standard headers from services like Linear and Okta with clear comments. This comprehensive approach ensures capturing all relevant rate limiting information.
Summary by CodeRabbit