THRIFT-6109: Format Ruby HTTP transport endpoint labels#3649
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Ruby Thrift::HTTPClientTransport endpoint label (#to_s) to produce a structured, sanitized identifier based on scheme/host/port/path, and extends specs to ensure userinfo/query secrets don’t appear in the label.
Changes:
- Change
Thrift::HTTPClientTransport#to_sto format asscheme(host:port/path)instead of returning the raw URL. - Add spec coverage asserting
#to_somits URL userinfo and query parameters.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lib/rb/spec/http_client_spec.rb | Updates/extends specs for HTTPClientTransport#to_s formatting and redaction. |
| lib/rb/lib/thrift/transport/http_client_transport.rb | Updates #to_s to emit a sanitized endpoint label (scheme/host/port/path). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9d77408 to
4a7c492
Compare
4a7c492 to
b0da77d
Compare
…t label Client: rb Co-Authored-By: OpenAI Codex (GPT-5.6) <codex@openai.com>
b0da77d to
000abd5
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
lib/rb/lib/thrift/transport/http_client_transport.rb:67
to_scurrently interpolates@url.hostdirectly. For IPv6 literals, Ruby'sURItypically returns the host without brackets (e.g.2001:db8::1), which makes thehost:portportion ambiguous and will not match the new spec expectationhttps([2001:db8::1]:8443/...). Wrap IPv6 hosts in[]when formatting the endpoint label.
path = @url.path.to_s
path = '/' if path.empty?
"#{@url.scheme}(#{@url.host}:#{@url.port}#{path})"
Code reviewNo issues found. Checked for bugs, AGENTS.md compliance, and security implications. 🤖 Generated with Claude Code |
Replace the malformed diagnostic label returned by
Thrift::HTTPClientTransport#to_swith an endpoint description that includes the scheme, host, port, and path.The label distinguishes HTTP from HTTPS while leaving URL userinfo and query parameters out of logs and exception output.
[skip ci]anywhere in the commit message to free up build resources.