1
0
mirror of https://github.com/pocket-id/pocket-id.git synced 2026-02-15 19:15:04 +00:00

feat: add CSP header (#908)

Co-authored-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
This commit is contained in:
Elias Schneider
2025-09-07 20:45:06 +02:00
committed by GitHub
parent 74b39e16f9
commit 6215e1ac01
9 changed files with 343 additions and 102 deletions

View File

@@ -2,13 +2,20 @@ import versionService from '$lib/services/version-service';
import type { AppVersionInformation } from '$lib/types/application-configuration';
import type { LayoutLoad } from './$types';
export const prerender = false;
export const load: LayoutLoad = async () => {
const currentVersion = versionService.getCurrentVersion();
let newestVersion = null;
let isUpToDate = true;
try {
newestVersion = await versionService.getNewestVersion();
isUpToDate = newestVersion === currentVersion;
} catch {}
const versionInformation: AppVersionInformation = {
currentVersion: versionService.getCurrentVersion(),
newestVersion: await versionService.getNewestVersion(),
isUpToDate: await versionService.isUpToDate()
newestVersion,
isUpToDate
};
return {