Skip to content

Commit 4c7e345

Browse files
authored
Release v1.13.3 (#12520)
* Release v1.13.3 * Fix incorrect billing when customAccessToken is provided along with non-Mapbox tiles
1 parent acb644e commit 4c7e345

File tree

5 files changed

+19
-9
lines changed

5 files changed

+19
-9
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 1.13.3
2+
3+
### 🐞 Bug fixes
4+
5+
* Fix incorrect billing when `customAccessToken` is provided along with non-Mapbox tiles ([#12520](https://github.com/mapbox/mapbox-gl-js/issues/12520))
6+
* Upgrade minimist to ^1.2.7 to avoid [CVE-2021-44906](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44906) ([#12442](https://github.com/mapbox/mapbox-gl-js/issues/12442)) (h/t @Spasfonx)
7+
18
## 1.13.2
29

310
### 🐞 Bug fixes

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "mapbox-gl",
33
"description": "A WebGL interactive maps library",
4-
"version": "1.13.2",
4+
"version": "1.13.3",
55
"main": "dist/mapbox-gl.js",
66
"style": "dist/mapbox-gl.css",
77
"license": "SEE LICENSE IN LICENSE.txt",
@@ -27,7 +27,6 @@
2727
"geojson-vt": "^3.2.1",
2828
"gl-matrix": "^3.2.1",
2929
"grid-index": "^1.1.0",
30-
"minimist": "^1.2.6",
3130
"murmurhash-js": "^1.0.0",
3231
"pbf": "^3.2.1",
3332
"potpack": "^1.0.1",
@@ -76,6 +75,7 @@
7675
"list-npm-contents": "^1.0.2",
7776
"lodash.template": "^4.5.0",
7877
"mapbox-gl-styles": "^2.0.2",
78+
"minimist": "^1.2.7",
7979
"mock-geolocation": "^1.0.11",
8080
"node-notifier": "^5.4.3",
8181
"npm-font-open-sans": "^1.1.0",

src/util/mapbox.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -385,14 +385,13 @@ export class MapLoadEvent extends TelemetryEvent {
385385
}
386386

387387
postMapLoadEvent(tileUrls: Array<string>, mapId: number, skuToken: string, customAccessToken: string) {
388-
//Enabled only when Mapbox Access Token is set and a source uses
389-
// mapbox tiles.
390388
this.skuToken = skuToken;
391389

392-
if (config.EVENTS_URL &&
393-
customAccessToken || config.ACCESS_TOKEN &&
394-
Array.isArray(tileUrls) &&
395-
tileUrls.some(url => isMapboxURL(url) || isMapboxHTTPURL(url))) {
390+
const accessTokenIsSet = !!(customAccessToken || config.ACCESS_TOKEN);
391+
const usesMapboxTiles = Array.isArray(tileUrls) && tileUrls.some(url => isMapboxURL(url) || isMapboxHTTPURL(url));
392+
393+
// Enabled only when Mapbox Access Token is set and a source uses mapbox tiles.
394+
if (config.EVENTS_URL && accessTokenIsSet && usesMapboxTiles) {
396395
this.queueRequest({id: mapId, timestamp: Date.now()}, customAccessToken);
397396
}
398397
}

test/unit/util/mapbox.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,7 @@ test("mapbox", (t) => {
750750

751751
t.end();
752752
});
753+
753754
t.test('MapLoadEvent', (t) => {
754755
let event;
755756
let turnstileEvent;
@@ -792,8 +793,11 @@ test("mapbox", (t) => {
792793

793794
t.test('does not POST when url does not point to mapbox.com', (t) => {
794795
event.postMapLoadEvent(nonMapboxTileURLs, 1, skuToken);
796+
t.equal(window.server.requests.length, 0);
795797

798+
event.postMapLoadEvent(nonMapboxTileURLs, 1, skuToken, 'customAccessToken');
796799
t.equal(window.server.requests.length, 0);
800+
797801
t.end();
798802
});
799803

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6973,7 +6973,7 @@ minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0, minimist@^1.
69736973
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
69746974
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
69756975

6976-
minimist@^1.2.6:
6976+
minimist@^1.2.6, minimist@^1.2.7:
69776977
version "1.2.7"
69786978
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18"
69796979
integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==

0 commit comments

Comments
 (0)