mathiasbynens / punycode.js

A robust Punycode converter that fully complies to RFC 3492 and RFC 5891.
https://mths.be/punycode
MIT License
1.59k stars 158 forks source link

punycode.toASCII places `xn--` before http or https #110

Closed redlpd closed 3 years ago

redlpd commented 4 years ago

Tried using punnycode.toASCII like this: punycode.toASCII('https://sample.com');

Actual result: xn--https://ggl-ykj0ia.com

Expected result: https://xn--ggl-ykj0ia.com

Hazmi35 commented 4 years ago

Same issue here

mathiasbynens commented 3 years ago

Yeah, you’re supposed to only pass it the domain name, not a full URL including a schema like http:// or https://. See the docs: https://github.com/bestiejs/punycode.js#punycodetoasciiinput