allow both pbf and mvt extensions for vector tiles for now. In the future, pbf option will be removed.

This commit is contained in:
Brandon Liu
2022-11-21 17:03:18 +08:00
parent 1da20f4f49
commit 1d74564ab4
2 changed files with 8 additions and 0 deletions

View File

@@ -170,6 +170,10 @@ export const handler = async (
[TileType.Webp, "webp"],
]) {
if (header.tileType === pair[0] && ext !== pair[1]) {
if (header.tileType == TileType.Mvt && ext === "pbf") {
// allow this for now. Eventually we will delete this in favor of .mvt
continue;
}
return apiResp(
400,
"Bad request: archive has type ." + pair[1],

View File

@@ -187,6 +187,10 @@ export default {
[TileType.Webp, "webp"],
]) {
if (p_header.tileType === pair[0] && ext !== pair[1]) {
if (p_header.tileType == TileType.Mvt && ext === "pbf") {
// allow this for now. Eventually we will delete this in favor of .mvt
continue;
}
return cacheableResponse(
"Bad request: archive has type ." + pair[1],
cacheable_headers,