Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use the less strict get#asBuffer which is not as finicky about Conten…

…t-Type headers.
  • Loading branch information...
commit 956a81fde8dd99d5f8758ea64aa0da70f3ffe7f6 1 parent 932a6d4
@yhahn yhahn authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/tilejson.js
View
4 lib/tilejson.js
@@ -219,7 +219,7 @@ TileJSON.prototype.getGrid = function(z, x, y, callback) {
timeout: this.timeout,
headers: {Connection:'Keep-Alive'},
agent: agent
- }).asString(function(err, grid, headers) {
+ }).asBuffer(function(err, grid, headers) {
if (err) return callback(new Error('Grid does not exist'));
var modified = headers['last-modified'] ? new Date(headers['last-modified']) : new Date;
@@ -233,7 +233,7 @@ TileJSON.prototype.getGrid = function(z, x, y, callback) {
}
// TODO: compression
- grid = grid.replace(/^\s*\w+\s*\(|\)\s*;?\s*$/g, '');
+ grid = grid.toString('utf8').replace(/^\s*\w+\s*\(|\)\s*;?\s*$/g, '');
callback(null, JSON.parse(grid), responseHeaders);
});
Please sign in to comment.
Something went wrong with that request. Please try again.