Skip to content

Commit 4568027

Browse files
Fixed Issue #1025 - URL-based glyphs and fonts break displaying of vector tiles (#1026)
Root cause: modified regex in #1002 caused URLs to be broken. Fixed by reverting previous regexes. Tests: * Confirmed by building and running locally with formerly breaking config.json and style json. * Run tests via Dockerfile_test
1 parent 471dd15 commit 4568027

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/serve_rendered.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {
3333
const FLOAT_PATTERN = '[+-]?(?:\\d+|\\d+.?\\d+)';
3434
const PATH_PATTERN =
3535
/^((fill|stroke|width)\:[^\|]+\|)*(enc:.+|-?\d+(\.\d*)?,-?\d+(\.\d*)?(\|-?\d+(\.\d*)?,-?\d+(\.\d*)?)+)/;
36-
const httpTester = /^\/\//;
36+
const httpTester = /^(http(s)?:)?\/\//;
3737

3838
const mercator = new SphericalMercator();
3939
const getScale = (scale) => (scale || '@1x').slice(1, 2) | 0;

src/serve_style.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { validate } from '@maplibre/maplibre-gl-style-spec';
99

1010
import { getPublicUrl } from './utils.js';
1111

12-
const httpTester = /^\/\//;
12+
const httpTester = /^(http(s)?:)?\/\//;
1313

1414
const fixUrl = (req, url, publicUrl, opt_nokey) => {
1515
if (!url || typeof url !== 'string' || url.indexOf('local://') !== 0) {

0 commit comments

Comments
 (0)