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
java.lang.IllegalArgumentException when try to use ipv6 #1883
Comments
This was version 0.14.0 |
What's better, is in this case (directaddress) we're actually trying to circumvent the NameResolver, so the URI is mostly unused. |
@zhangkun83, do you want to take a look at this? |
@ejona86 haha ok :) |
zhangkun83
added a commit
to zhangkun83/grpc-java
that referenced
this issue
Jun 3, 2016
This fixes two issues. 1. Use the URI constructor with multiple arguments to construct the placeholder URI for direct address, so that special characters can be correctly escaped. This resolves grpc#1883. It requires the second fix. 2. Stop URI from mistreating paths as authorities. There is a bug in URI constructors that take multiple arguments. They simply concatenate escaped components and try to parse the resulting string. For example, URI("dns", null, "//127.0.0.1", null), which is what we do internally when the application passes "/127.0.0.1" as the target, is supposed to create a [scheme="dns", path="//127.0.0.1"]. Instead, it internally composes "dns://127.0.0.1", and gets a [scheme="dns", authority="127.0.0.1"]. To avoid this issue, we pass empty string instead of null as the authority to the URI constructor. The constructor would make "dns:////127.0.0.1" internally which can be parsed correctly.
zhangkun83
added a commit
to zhangkun83/grpc-java
that referenced
this issue
Jun 3, 2016
This fixes two issues. 1) Use the URI constructor with multiple arguments to construct the placeholder URI for direct address, so that special characters can be correctly escaped. This resolves grpc#1883. It requires the second fix. 2) Stop URI from mistreating paths as authorities. There is a bug in URI constructors that take multiple arguments. They simply concatenate escaped components and try to parse the resulting string. For example, URI("dns", null, "//127.0.0.1", null), which is what we do internally when the application passes "/127.0.0.1" as the target, is supposed to create a [scheme="dns", path="//127.0.0.1"]. Instead, it internally composes "dns://127.0.0.1", which is parsed into [scheme="dns", authority="127.0.0.1"]. To avoid this issue, we pass empty string instead of null as the authority to the URI constructor. The constructor would make "dns:////127.0.0.1" internally which can be parsed correctly.
Merged
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I guess this is caused by the scopeId:
The text was updated successfully, but these errors were encountered: