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

Support ipv6 link-local addresses #470

Closed
socs opened this issue Mar 24, 2021 · 1 comment
Closed

Support ipv6 link-local addresses #470

socs opened this issue Mar 24, 2021 · 1 comment

Comments

@socs
Copy link
Contributor

socs commented Mar 24, 2021

URL parsing fails on ipv6 link-local addresses, eg

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let _ = redis::Client::open("[fe80::1%foo]:6379")?; // -> Error: Redis URL did not parse
    Ok(())
}

This works with redis-cli

# redis-cli -h fe80::1%foo -p 6379
[fe80::1%foo]:6379> ping
PONG

The limitation stems from rust-url library which follows a url spec that omits zone identifier on ipv6 ll addresses.
Perhaps a custom parser could be used by redis-rs, such as the one in redis-cli, so that ipv6 ll addresses is accepted.

jaymell pushed a commit that referenced this issue Sep 14, 2022
@djc
Copy link
Contributor

djc commented Sep 14, 2022

Should be fixed with #679.

@djc djc closed this as completed Sep 14, 2022
nonirosenfeldredis pushed a commit to nonirosenfeldredis/redis-rs that referenced this issue Feb 13, 2023
socs added a commit to socs/redis-rs that referenced this issue Mar 1, 2023
URL parsing fails when the host is a ipv6 link-local address due to
zone identifiers being omitted by the url spec.
https://url.spec.whatwg.org/#host-representation

This fix resolves the issue by stripping the zone id from the url but
adding it back into the host field during conversion to ConnectionInfo.
socs added a commit to socs/redis-rs that referenced this issue Mar 1, 2023
URL parsing fails when the host is a ipv6 link-local address due to
zone identifiers being omitted by the url spec.
https://url.spec.whatwg.org/#host-representation

This fix resolves the issue by stripping the zone id from the url but
adding it back into the host field during conversion to ConnectionInfo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants