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

https.nonProxyHosts does not handle * wildcard #1092

Closed
grassehh opened this issue May 16, 2024 · 1 comment
Closed

https.nonProxyHosts does not handle * wildcard #1092

grassehh opened this issue May 16, 2024 · 1 comment
Labels
bug This issue is a bug.

Comments

@grassehh
Copy link

Describe the bug

The * wildcard does not work when using https.nonProxyHosts

Expected behavior

As described in the Java specifications:
http.nonProxyHosts:a list of hosts that should be reached directly, bypassing the proxy. This is a list of patterns separated by '|'. The patterns may start or end with a '*' for wildcards. Any host matching one of these patterns will be reached through a direct connection instead of through a proxy.

So when configuring a host which starts or ends with a * wildcard should match. For example:
my.host should both match the non proxy hosts *.host and my.*

Current behavior

The host does not match non proxy hosts when using *.
For example: my.host won't match the non proxy hosts *.host and my.*

Steps to Reproduce

Simply configure a client using environment while having defined *.host in http.nonProxyHosts system property. For example:

S3Client.fromEnvironment {}

Then if you make a request to the host my-host defined in the system property, the http client will still try to go through the proxy because it has not matched the non proxy host.

Possible Solution

Fix this method so that it handle hostMatch that starts or ends with * wildcard

Context

No response

Smithy-Kotlin version

1.2.2

Platform (JVM/JS/Native)

Java 21

Operating system and version

Debian 12

@grassehh grassehh added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 16, 2024
@ianbotsf ianbotsf removed the needs-triage This issue or PR still needs to be triaged. label May 16, 2024
@ianbotsf
Copy link
Contributor

Thanks for the bug report, @grassehh! We've merged a fix to main and we'll work on getting it out in tomorrow's SDK release.

sullis pushed a commit to sullis/smithy-kotlin that referenced this issue Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants