fix: resolves Unimplemented type: 3 error for geojson format (#1465)

* fix: resolves Unimplemented type: 3 error for geojson format

* fix: removing duplicate zlib import

* fix: remove redundant change to headers

* revert fix decimal length

* lint fix

---------

Co-authored-by: Andrew Calcutt <acalcutt@techidiots.net>
This commit is contained in:
RJ Johnston 2025-03-16 14:51:12 -04:00 committed by GitHub
parent 6d1c617752
commit 8a7d9957fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,6 +21,7 @@ import { openMbTilesWrapper } from './mbtiles_wrapper.js';
import fs from 'node:fs';
import { fileURLToPath } from 'url';
const packageJson = JSON.parse(
fs.readFileSync(
path.dirname(fileURLToPath(import.meta.url)) + '/../package.json',
@ -113,12 +114,13 @@ export const serve_data = {
let headers = fetchTile.headers;
let isGzipped = data.slice(0, 2).indexOf(Buffer.from([0x1f, 0x8b])) === 0;
if (tileJSONFormat === 'pbf') {
if (options.dataDecoratorFunc) {
if (isGzipped) {
data = await gunzipP(data);
isGzipped = false;
}
if (tileJSONFormat === 'pbf') {
if (options.dataDecoratorFunc) {
data = options.dataDecoratorFunc(
req.params.id,
'data',