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

Handle null uri.pathname bug #142

Merged
merged 2 commits into from
May 15, 2016
Merged

Handle null uri.pathname bug #142

merged 2 commits into from
May 15, 2016

Conversation

nyurik
Copy link
Contributor

@nyurik nyurik commented Aug 7, 2015

Sometimes modules do not require a full path,
and can use shorter version, e.g. overzoom://?source=blah
which results in the null pathname, which fails in the unescape.

@@ -76,7 +76,8 @@ tilelive.load = function(uri, callback) {

if (typeof uri === 'string') {
uri = url.parse(uri, true);
uri.pathname = qs.unescape(uri.pathname);
if (uri.pathname)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use brackets for multiline if statements.

@nyurik nyurik force-pushed the master branch 2 times, most recently from 9d54027 to 676b098 Compare January 21, 2016 19:25
@nyurik
Copy link
Contributor Author

nyurik commented Jan 21, 2016

@tmcw thx, didn't see your comment, fixed.

Sometimes modules do not require a full path,
and can use shorter version, e.g.   overzoom://?source=blah
which results in the null pathname, which fails in the unescape.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 97.685% when pulling 8eb6cfe on nyurik:master into 389291a on mapbox:master.

@nyurik
Copy link
Contributor Author

nyurik commented Apr 6, 2016

@tmcw is there anything preventing this PR? thx!

@rclark
Copy link
Contributor

rclark commented Apr 7, 2016

Looks like this keeps failing one test on node 0.12.x.

@nyurik
Copy link
Contributor Author

nyurik commented Apr 8, 2016

@rclark I just installed node v0.12.13 using nvm, did npm install and npm test, and it all passes on my machine. Could this be a bug in travis?

@rclark
Copy link
Contributor

rclark commented Apr 8, 2016

Thanks for investigating -- I reran the travis test and it passed, so some other issue.

My only other request would be a test that asserts a URI without a path parses successfully, to protect against any future regression.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 97.685% when pulling 2310624 on nyurik:master into 389291a on mapbox:master.

@nyurik
Copy link
Contributor Author

nyurik commented Apr 8, 2016

@rclark added. Also, in the process i discovered that this bug only happens for node 0.10. In node 0.12, the patch is no longer relevant

@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 97.685% when pulling 3714051 on nyurik:master into 389291a on mapbox:master.

@rclark rclark merged commit 6855e96 into mapbox:master May 15, 2016
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.

None yet

4 participants