Possible bug in jsdom/whatwg-url

201 views
Skip to first unread message

yyz

unread,
Apr 8, 2016, 4:38:55 PM4/8/16
to jsdom

While playing with some jquery/ajax stuff in node.js, I think I’ve hit a bug in the whatwg-url module used by jsdom.

It’s unable to parse certain valid URLs such as: "https://r3---sn-p5qlsnz6.googlevideo.com/" and throws "TypeError: Invalid URL".

I think the problem is with the “r3---sn” part of the hostname. 

Are there any workarounds to get past this? Thanks!

Domenic Denicola

unread,
Apr 8, 2016, 4:45:45 PM4/8/16
to js...@googlegroups.com

Can you file an issue on the repo, with a small code sample that reproduces the problem?

--
You received this message because you are subscribed to the Google Groups "jsdom" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsdom+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

yyz

unread,
Apr 9, 2016, 4:17:17 PM4/9/16
to jsdom
Following node.js code reproduces the issue:
var url = "https://r3---sn-p5qlsnz6.googlevideo.com/";
parseURL = require("whatwg-url").parseURL;
var result = parseURL(url);

Output:
../node_modules/whatwg-url/lib/url-state-machine.js:1151
    throw new TypeError("Invalid URL");
    ^
TypeError: Invalid URL
    at Object.module.exports.basicURLParse (../node_modules/whatwg-url/lib/url-state-machine.js:1151:11)
    at module.exports.parseURL (../node_modules/whatwg-url/lib/url-state-machine.js:1189:25)
    at Object.<anonymous> (test.js:5:14)

Issue created on the repo. Thanks!
Reply all
Reply to author
Forward
0 new messages