tileserver-gl-light 5.4.0-pre.2 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # tileserver-gl changelog
2
2
 
3
- ## 5.4.0-pre.2
3
+ ## 5.4.0
4
4
  * Fix the issue where the tile URL cannot be correctly parsed with the HTTPS protocol when using an nginx proxy service (https://github.com/maptiler/tileserver-gl/pull/1578) by @dakanggo
5
5
  * Use jemalloc as memory allocator in the docker image (https://github.com/maptiler/tileserver-gl/pull/1574) by @MichielMortier
6
6
  * Rasters: Add tileSize to TileJSON (https://github.com/maptiler/tileserver-gl/pull/1559) by @roblabs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tileserver-gl-light",
3
- "version": "5.4.0-pre.2",
3
+ "version": "5.4.0",
4
4
  "description": "Map tile server for JSON GL styles - serving vector tiles",
5
5
  "main": "src/main.js",
6
6
  "bin": "src/main.js",
@@ -1202,10 +1202,30 @@ export const serve_rendered = {
1202
1202
  parsedResponse.data = responseData;
1203
1203
  callback(null, parsedResponse);
1204
1204
  } catch (error) {
1205
- const parts = url.parse(req.url);
1206
- const extension = path.extname(parts.pathname).toLowerCase();
1207
- const format = extensionToFormat[extension] || '';
1208
- createEmptyResponse(format, '', callback);
1205
+ if (error.response && error.response.status === 410) {
1206
+ // This is the 410 "Gone" error, treat as sparse
1207
+ if (verbose) {
1208
+ console.log(
1209
+ 'fetchTile warning on %s, sparse response due to 410 Gone',
1210
+ req.url,
1211
+ );
1212
+ }
1213
+ callback();
1214
+ } else {
1215
+ // For all other errors (e.g., network errors, 404, 500, etc.) return empty content.
1216
+ console.error(
1217
+ `Error fetching remote URL ${req.url}:`,
1218
+ error.message || error,
1219
+ error.response
1220
+ ? `Status: ${error.response.status}`
1221
+ : 'No response received',
1222
+ );
1223
+
1224
+ const parts = url.parse(req.url);
1225
+ const extension = path.extname(parts.pathname).toLowerCase();
1226
+ const format = extensionToFormat[extension] || '';
1227
+ createEmptyResponse(format, '', callback);
1228
+ }
1209
1229
  }
1210
1230
  } else if (protocol === 'file') {
1211
1231
  const name = decodeURI(req.url).substring(protocol.length + 3);