Skip to content

Commit 4b43c83

Browse files
committed
Limit block cache size to 5GiB
This fixes an issue with secret links being truncated when a large block cache is present
1 parent 4dd0682 commit 4b43c83

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: vendor/priors/gwt.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ var accountStoreCache;
545545
var pkiStoreCache;
546546
var rootKeyCache;
547547
let SAFARI_CACHE_SIZE = 1024 * 1024 * 700;
548+
let MAX_CACHE_SIZE = 1024 * 1024 * 1024 * 5;
548549

549550
function bindCacheStore(storeCache) {
550551
blockStoreCache = storeCache;
@@ -641,7 +642,7 @@ function isSafariTest() {
641642
}
642643
function getBrowserStorageQuota() {
643644
if (navigator.storage && navigator.storage.estimate) {
644-
return navigator.storage.estimate().then(quota => quota.quota);
645+
return navigator.storage.estimate().then(quota => Math.min(MAX_CACHE_SIZE, quota.quota));
645646
} else {
646647

647648
let prom = new Promise(function(resolve, reject) { resolve(isSafariTest() ? SAFARI_CACHE_SIZE : 0)});

0 commit comments

Comments
 (0)