fix sonar findings and translation structure
This commit is contained in:
@@ -10,7 +10,7 @@ globalThis.Wegwichtel ??= {};
|
||||
|
||||
function key(value) {
|
||||
const url = new URL(value, globalThis.location.origin);
|
||||
if (url.origin !== globalThis.location.origin) throw new TypeError(ns.I18n.t("offline-storage.inhalte.von.anderen.seiten.konnen.hier.nicht"));
|
||||
if (url.origin !== globalThis.location.origin) throw new TypeError(ns.I18n.t("offline-storage.error.foreign-origin"));
|
||||
url.searchParams.delete('v');
|
||||
if (url.pathname.startsWith('/api/')) url.searchParams.delete('_');
|
||||
url.hash = '';
|
||||
@@ -60,7 +60,7 @@ globalThis.Wegwichtel ??= {};
|
||||
}
|
||||
|
||||
async function put(stage, url, response) {
|
||||
if (!response.ok || response.type === 'opaque') throw new Error(ns.I18n.t("offline-storage.ein.teil.konnte.nicht.gespeichert.werden.prufe"));
|
||||
if (!response.ok || response.type === 'opaque') throw new Error(ns.I18n.t("offline-storage.error.response"));
|
||||
const normalized = key(url);
|
||||
if (stage.mode === 'cache') {
|
||||
const cache = await caches.open(stage.id);
|
||||
|
||||
Reference in New Issue
Block a user