Skip to content

Ipv4 type host is getting parsed as Domain type with uncommon scheme #1081

@tkanakamalla

Description

@tkanakamalla

Describe the bug
In case of an uncommon scheme, like udp, a Host::Ipv4 type is actually getting parsed as Host::Domain.

This is not a problem in case of an Ipv6 though.

here is an example:

fn main() {
    
    let y = url::Url::parse("udp://127.0.0.1").unwrap();
    println!("{y}");
    println!("{:?}", y.host());
    
    let y = url::Url::parse("http://127.0.0.1").unwrap();
    println!("{y}");
    println!("{:?}", y.host());
    
    let y = url::Url::parse("udp://[::1]").unwrap();
    println!("{y}");
    println!("{:?}", y.host());
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions