feat: add getBaseUrl function for consistent base URL generation across routes
All checks were successful
Build & Push Docker Image / build (push) Successful in 6m28s

feat(calendar): display local timezone in calendar view
feat(i18n): add timezone label to German and English translations
This commit is contained in:
2026-03-04 09:44:02 +01:00
parent 61274d31f1
commit 43d94181f9
11 changed files with 54 additions and 28 deletions

View File

@@ -14,6 +14,7 @@ import { Router, text } from 'express';
import crypto from 'crypto';
import { getDb } from '../config/database.js';
import { log } from '../config/logger.js';
import { getBaseUrl } from '../middleware/auth.js';
const router = Router();
@@ -239,12 +240,8 @@ function validateCalDAVUser(req, res, next) {
next();
}
// ── Base URL helper ────────────────────────────────────────────────────────
function baseUrl(req) {
const proto = req.get('x-forwarded-proto') || req.protocol;
const host = req.get('x-forwarded-host') || req.get('host');
return `${proto}://${host}`;
}
// ── Base URL helper (uses shared getBaseUrl from auth.js) ──────────────────
const baseUrl = getBaseUrl;
// ── PROPFIND response builders ─────────────────────────────────────────────