fix error when mbtiles path contains a space
root cause is that qs.parse() unescapes URL components while url.parse() does not. https://groups.google.com/forum/#!topic/nodejs/8P7GZqBw0xg http://nodejs.org/api/querystring.html#querystring_querystring_unescape
This commit is contained in:
@@ -31,8 +31,11 @@ MBTiles.schema = fs.readFileSync(__dirname + '/schema.sql', 'utf8');
|
||||
// - callback: Will be called when the resources have been acquired
|
||||
// or acquisition failed.
|
||||
require('util').inherits(MBTiles, require('events').EventEmitter)
|
||||
function MBTiles(uri, callback) {
|
||||
if (typeof uri === 'string') uri = url.parse(uri, true);
|
||||
function MBTiles(uri, callback) {
|
||||
if (typeof uri === 'string') {
|
||||
uri = url.parse(uri, true);
|
||||
uri.pathname = qs.unescape(uri.pathname);
|
||||
}
|
||||
else if (typeof uri.query === 'string') uri.query = qs.parse(uri.query);
|
||||
|
||||
if (!uri.pathname) {
|
||||
|
||||
Reference in New Issue
Block a user