Skip to content

Commit

Permalink
feat(clusterbuster): Make sure we escape x, y and z (#53)
Browse files Browse the repository at this point in the history
* feat(clusterbuster): Make sure we escape x, y and z

* feat(clusterbuster): In case of invalid x,y or z throw errors
  • Loading branch information
cosmin-petrescu committed Jun 29, 2020
1 parent 4da2914 commit a47d246
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/tiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ export async function TileServer<T>({
}
let query: string;

z = parseInt(`${z}`, 10);
if (isNaN(z)) {
throw new Error('Invalid zoom level');
}

x = parseInt(`${x}`, 10);
y = parseInt(`${y}`, 10);
if (isNaN(x) || isNaN(y)) {
throw new Error('Invalid tile coordinates');
}

try {
query = createQueryForTile({
z,
Expand Down

0 comments on commit a47d246

Please sign in to comment.