Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProxyOptions setNonProxyHosts ability to support regex restricted by 18156 #25038

Closed
jasonparallel opened this issue Oct 26, 2021 · 4 comments · Fixed by #25841
Closed

ProxyOptions setNonProxyHosts ability to support regex restricted by 18156 #25038

jasonparallel opened this issue Oct 26, 2021 · 4 comments · Fixed by #25841
Assignees
Labels
Azure.Core azure-core Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@jasonparallel
Copy link

jasonparallel commented Oct 26, 2021

Prior to #18156 setNonProxyHosts could support any regex. After 18156 only wildcards and only at the start or end are supported.

The java doc on setNonProxyHosts stayed the same before and after this change
Individual host strings may contain regex characters such as {@code '*'}.

It seems like the javadoc should reflect this reduction in the accepted input.

It would also be great if the old functionality was restored to allow a generic regex to be supplied perhaps via setNonProxyHostsRegex

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Oct 26, 2021
@joshfree joshfree added Azure.Core azure-core Client This issue points to a problem in the data-plane of the library. labels Oct 26, 2021
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Oct 26, 2021
@joshfree
Copy link
Member

@alzimmermsft could you please take a look?

@alzimmermsft
Copy link
Member

alzimmermsft commented Oct 26, 2021

@jasonparallel, yes this would be a great idea to re-introduce full regex support for nonProxyHosts.

Do you have any example regexes you'll be using that I can add them as part of testing?

@jasonparallel
Copy link
Author

@alzimmermsft We have a user defined regex of what to proxy so we have to wrap it in a negative look around when interacting with the sdk/netty.

Is the SDK doing the determination or just passing the regex into netty to let it do the determination?

@alzimmermsft
Copy link
Member

Is the SDK doing the determination or just passing the regex into netty to let it do the determination?

Depends on the configuration of the proxy. If the proxy is authenticated we handle determination but otherwise it is passed along to Netty.

A quick fix to this would be attempting to Pattern.compile the nonProxyHosts string, if that passes use it as the regex to determine pass-through but if not fallback to the more restrictive handling. For reference the handling being done now aligns with the JDK default and what Reactor Netty does.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Core azure-core Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants