From 70d670b71125dc5bcc5fcb71f8a9095f1ae4ac0d Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 17 Aug 2022 23:23:39 +0200 Subject: [PATCH] Bugfix/fix license (#1160) * Fix license * Update changelog --- CHANGELOG.md | 4 ++-- apps/api/src/app/frontend.middleware.ts | 20 +++++++++----------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f330c53f6..207d2b5ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,9 +16,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Tagged template literal strings in components for localization with `$localize` -### Changed +### Fixed -- Tagged template literal strings in components for localization with `$localize` +- Fixed the license component in the about page ## 1.179.5 - 15.08.2022 diff --git a/apps/api/src/app/frontend.middleware.ts b/apps/api/src/app/frontend.middleware.ts index bca60f8c9..54bdcd49a 100644 --- a/apps/api/src/app/frontend.middleware.ts +++ b/apps/api/src/app/frontend.middleware.ts @@ -11,22 +11,20 @@ export class FrontendMiddleware implements NestMiddleware { // Skip next(); } else if (req.path.startsWith('/de/')) { - res.sendFile(path.join(__dirname, '..', 'client', 'de', 'index.html')); + res.sendFile(this.getPathOfIndexHtmlFile('de')); } else { - res.sendFile( - path.join( - __dirname, - '..', - 'client', - DEFAULT_LANGUAGE_CODE, - 'index.html' - ) - ); + res.sendFile(this.getPathOfIndexHtmlFile(DEFAULT_LANGUAGE_CODE)); } } + private getPathOfIndexHtmlFile(aLocale: string) { + return path.join(__dirname, '..', 'client', aLocale, 'index.html'); + } + private isFileRequest(filename: string) { - if (filename.includes('auth/ey')) { + if (filename === '/assets/LICENSE') { + return true; + } else if (filename.includes('auth/ey')) { return false; }