[rb] trim whitespace around NO_PROXY entries#17565
Conversation
Review Summary by QodoTrim whitespace around NO_PROXY entries in Ruby
WalkthroughsDescription• Fix NO_PROXY parsing to trim whitespace around entries • Standardize no_proxy splitting across two Ruby files • Handle both comma-separated and comma-space-separated formats • Add comprehensive test coverage for whitespace handling Diagramflowchart LR
A["NO_PROXY string with whitespace"] -->|split and trim| B["Clean array of hosts"]
B -->|proxy matching logic| C["Correct proxy bypass decision"]
D["common/proxy.rb"] -->|updated parsing| B
E["remote/http/default.rb"] -->|updated parsing| B
File Changes1. rb/lib/selenium/webdriver/common/proxy.rb
|
Code Review by Qodo
Context used 1. Array no_proxy unsupported
|
|
Persistent review updated to latest commit ec1c324 |
|
Persistent review updated to latest commit d7c4046 |
🔗 Related Issues
#17460
💥 What does this PR do?
This commit fixes the bug #17460 where
NO_PROXY/no_proxyentries were parsed without trimming surrounding whitespace, so values likelocalhost, 127.0.0.1would not match the target host and Selenium would not bypass the proxy as expected. I also updated the tests.🔧 Implementation Notes
Two sites were splitting
no_proxydifferently:remote/http/default.rbusedsplit(',')without trimming, so entries with leading spaces never matched the server host.common/proxy.rb#as_jsonusedsplit(', '), which failed for comma-only separated values likeproxy_url,localhost.Both now use
split(',').map(&:strip).reject(&:empty?)so the parsing is consistent and tolerant of surrounding whitespace.🔄 Types of changes