Skip to content

Match nonProxyHosts entries without regular expressions - #7614

Open
S-Saranya1 wants to merge 1 commit into
masterfrom
somepal/fix-nonproxyhosts-regex-matching
Open

S-Saranya1 wants to merge 1 commit into
masterfrom
somepal/fix-nonproxyhosts-regex-matching

Conversation

@S-Saranya1

@S-Saranya1 S-Saranya1 commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Motivation and Context

The docs say nonProxyHosts entries are host names, but the Apache, Apache 5, URL connection and Netty clients were matching them as regular expressions. So example.com also matched exampleXcom, and a builder entry like *.example.com failed on every request.

Entries that relied on regex syntax, like .*.example.com, no longer match, so those hosts now go through the proxy. *.example.com is the replacement.

This makes the four clients match entries the way the docs describe.

Modifications

  • Added a small internal matcher in utils. Everything in an entry is literal except *, which matches any run of characters. Matching ignores case.
  • Wildcards from the http.nonProxyHosts system property and NO_PROXY still work.
  • Apache, Apache 5, URL connection and Netty now use it. It's built once per client, not on every request.
  • Updated the nonProxyHosts Javadoc in the four clients, and removed the CIDR mention since it was never supported.

Testing

  • Added unit tests.

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance improvement (non-breaking change which improves latency, throughput, or resource use)
  • Deprecation (marks existing functionality as deprecated)
  • Removal (removes previously deprecated functionality)
  • Documentation (changes to documentation only)
  • Other (tests, build, CI, or refactoring with no customer-visible change)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

AI tools

  • I wrote this pull request description myself, not with an AI tool
  • I have reviewed all changes in this pull request myself, including any generated by AI tools

License

  • I confirm that this pull request can be released under the Apache 2 license

@S-Saranya1
S-Saranya1 requested a review from a team as a code owner December 4, 2026 21:43
@S-Saranya1 S-Saranya1 added the no-api-surface-area-change Indicate there is no API surface area change and thus API surface area review is not required label Dec 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-api-surface-area-change Indicate there is no API surface area change and thus API surface area review is not required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant