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

Punycode branch drops some 0s when setting from an IP address #866

Open
MitchellBot opened this issue Oct 3, 2024 · 3 comments
Open

Punycode branch drops some 0s when setting from an IP address #866

MitchellBot opened this issue Oct 3, 2024 · 3 comments

Comments

@MitchellBot
Copy link

We're using the punycode branch to parse URIs and recently stumbled upon an issue where IP addresses with multiple 0s will drop some of them during parsing.

For instance, given the IP address 192.168.108.100, if you either set_host or set_host_address and then re-print the object, it will come out as 192.168.18.10.

Example:

    boost::urls::url someUrl;
    someUrl.set_host("192.168.108.100");
    std::cout << "URL is: " << someUrl.c_str() << std::endl;

Output:
URL is: //192.168.18.10

Interestingly, even using an ipv4 object directly doesn't work:

        boost::urls::url someUrl;
        someUrl.set_host_ipv4(boost::urls::ipv4_address("192.168.108.100"));
        std::cout << "Boost url (by IP) is: " << someUrl.c_str() << std::endl;

Output:
Boost url (by IP) is: //192.168.18.10

I see that the punycode branch hasn't been updated in quite some time, is it possible that this is already known and has been fixed in develop?

@alandefreitas
Copy link
Member

Punycode was a short experiment that’s discontinued. It never made it to develop.

What’s your use case for punycode?

@MitchellBot
Copy link
Author

After discussing with my colleagues no one seems to recollect choosing that branch to begin with. It may have been mistakenly downloaded.

@alandefreitas
Copy link
Member

I see. Yes. Punycode never made it to Boost. This punycode implementation is probably not even compatible with the latest version of Boost.URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants