Skip to content

Conversation

@tromey
Copy link
Contributor

@tromey tromey commented Sep 25, 2017

urlRegexp was requiring that there be no spaces in the path component of
the URL. However, this is overly strict; and in particular webpack
creates URLs with an embedded space.
Fixes #267

Copy link

@julienw julienw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm !

Please wait for a green Travis before merging :)

"names":[],
"mappings":"CAAS",
"file":"static/js/manifest.b7cf97680f7a50fa150f.js",
"sourceRoot":""
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: no need to quote the keys here :) Also, please add spaces after the colons.

(would make sense to add prettier eventually)

exports.getArg = getArg;

var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(\S*)$/;
var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While reviewing, I realized that in isAbsolute, you should use urlRegexp.test(aPath) instead of aPath.match(urlRegexp) because you don't need the matches, so it should be faster. You can do it in this patch or in another patch if you want.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this change causes many regressions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... because I wrote it incorrectly.

urlRegexp was requiring that there be no spaces in the path component of
the URL.  However, this is overly strict; and in particular webpack
creates URLs with an embedded space.
Fixes mozilla#267
@tromey tromey merged commit eb182f0 into mozilla:master Sep 25, 2017
@tromey tromey deleted the url-parsing-fix branch September 25, 2017 17:43
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

Successfully merging this pull request may close these issues.

2 participants