-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
HttpUrl host decode IPv6 address issue #4451
Comments
Ugh, OkHttp shouldn't fail like this. It should detect IPv4 mapped addresses and respond accordingly. https://en.m.wikipedia.org/wiki/IPv6#IPv4-mapped_IPv6_addresses |
yeah, as you say, "::ffff:c0a8:1fe" is a IPv4-mapped IPv6 addresses I also tried "::ffff:192.0.2.128"、"::192.0.2.128"、"0000:0000:0000:0000:0000:FFFF:C0A8:01FE" very thanks for you replay. |
Because it's an IPv4 address OkHttp will only use IPv4 to connect to this host. |
oh, thanks very much |
Still worth investigation: do we throw an error we shouldn't when attempting to decode something that looks like an IPv6 address? |
I was worried we weren't handling this case correctly. Fortunately we are. Closes: #4451
I was worried we weren't handling this case correctly. Fortunately we are. Closes: #4451
@test
public void test() {
java.lang.AssertionError: Invalid IPv6 address: '::ffff:c0a8:1fe'
The network is right , I can request with IPv4 , but cant with IPv6, please tell me how?
The text was updated successfully, but these errors were encountered: