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

Bug in pure Ruby punycode implementation #215

Closed
dentarg opened this issue Oct 23, 2015 · 1 comment
Closed

Bug in pure Ruby punycode implementation #215

dentarg opened this issue Oct 23, 2015 · 1 comment
Labels

Comments

@dentarg
Copy link
Collaborator

dentarg commented Oct 23, 2015

[32] pry(main)> Addressable::IDNA.to_unicode("xn--...-")
NoMethodError: undefined method `size' for nil:NilClass

I think it's blowing up on this line:

if ACE_MAX_LENGTH * 2 < punycode.size

Use case, I'm trying to parse http://xn--...-/

[21] pry(main)> Addressable::URI.heuristic_parse("http://xn--...-/").display_uri
NoMethodError: undefined method `size' for nil:NilClass

The native solution works fine:

[1] pry(main)> require "addressable/idna/native"
=> false
[2] pry(main)> Addressable::IDNA.to_unicode("xn--...-")
=> "xn--...-"
@dentarg dentarg changed the title Bug in native punycode implementation Bug in pure Ruby punycode implementation Nov 3, 2015
@sporkmonger
Copy link
Owner

Fixed in cf8cc7d.

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

No branches or pull requests

2 participants