Skip to content

Fix non-proxy host suffix wildcard sanitization - #51347

Closed
Arnab Nandy (arnabnandy7) wants to merge 1 commit into
Azure:mainfrom
arnabnandy7:fix/nonProxyHostSuffix
Closed

Arnab Nandy (arnabnandy7) wants to merge 1 commit into
Azure:mainfrom
arnabnandy7:fix/nonProxyHostSuffix

Conversation

@arnabnandy7

Copy link
Copy Markdown
Contributor

Description

Fixes #51341.

Corrects non-proxy host suffix wildcard sanitization in azure-core and clientcore. Previously, suffix trimming removed an extra literal character, allowing unintended hosts to bypass the proxy. For example, storage1* also matched storage2.example.com, and 10.* matched 100.64.0.1.

The fix preserves literal characters, removes unreachable suffix branches, and prevents the .* entry from throwing an exception. Adds JavaDoc examples, changelog entries, and regression tests covering programmatic configuration, Java proxy properties, SDK proxy properties, and NO_PROXY.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
Copilot AI balanced review requested due to automatic review settings November 19, 2026 18:07
@azure-sdk-automation

Copy link
Copy Markdown
Contributor

The sdk-api-review-ready label cannot create a review PR for this working PR because its branch is in a fork repository. Prefer a working branch in the registered upstream repository, or reach out to the ARH maintainers for help. Fork reviews are supported through the Azure SDK CLI (azsdk apireview create), but the fork requires its own ARH registration and the review PR is created in the fork rather than the upstream repository.

@github-actions github-actions Bot added Azure.Core azure-core clientcore Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Nov 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution Arnab Nandy (@arnabnandy7)! We will review the pull request and get back to you soon.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
33 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the proxy wildcard handling changes.

No open issues 🎉

What changed in this PR

Fixes #51341 by correcting non-proxy host suffix wildcard handling in azure-core and clientcore, preventing unintended hosts from bypassing the proxy.

Changes:

  • Corrects suffix trimming, removes unreachable branches, and prevents an exception for .*.
  • Adds regression tests across programmatic configuration, Java and SDK proxy properties, and NO_PROXY.
  • Documents wildcard behavior with JavaDoc examples and changelog entries.
File Description
sdk/​core/​azure-core/​src/​test/​java/​com/​azure/​core/​http/​ProxyOptionsTests.java Adds suffix wildcard regression tests across configuration sources.
sdk/​core/​azure-core/​src/​main/​java/​com/​azure/​core/​http/​ProxyOptions.java Fixes suffix trimming and documents literal-dot behavior.
sdk/​core/​azure-core/​CHANGELOG.md Records the proxy bypass and exception fixes.
sdk/​clientcore/​core/​src/​test/​java/​io/​clientcore/​core/​http/​models/​ProxyOptionsTests.java Adds equivalent clientcore regression tests.
sdk/​clientcore/​core/​src/​main/​java/​io/​clientcore/​core/​http/​models/​ProxyOptions.java Applies the same sanitization fix and JavaDoc examples.
sdk/​clientcore/​core/​CHANGELOG.md Records the corresponding clientcore fixes.

Review effort: Balanced

@vcolin7

vcolin7 commented Nov 20, 2026

Copy link
Copy Markdown
Member

Hi Arnab Nandy (@arnabnandy7), thanks for the contribution and the continuous effort to make the Azure SDK for Java better :)

I had already started to work on the reported issue and found few more edge cases than the ones covered in this PR, so I'll be closing it in favor of #51356 this time around.

@vcolin7 vcolin7 closed this Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Azure.Core azure-core clientcore Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] ProxyOptions: suffix wildcards in non-proxy hosts strip one character too many (storage1* also matches storage2.example.com)

3 participants