From 284b87dae85a356dd543a03f81d12031b11f7554 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Mon, 2 Mar 2026 16:05:12 -0500 Subject: split url into webUrl and localUrl (like mastodon) --- packages/backend/src/server/ServerService.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'packages/backend/src/server/ServerService.ts') diff --git a/packages/backend/src/server/ServerService.ts b/packages/backend/src/server/ServerService.ts index 77b4519570..0d8fc9adbe 100644 --- a/packages/backend/src/server/ServerService.ts +++ b/packages/backend/src/server/ServerService.ts @@ -85,7 +85,7 @@ export class ServerService implements OnApplicationShutdown { // HSTS // 6months (15552000sec) - if (this.config.url.startsWith('https') && !this.config.disableHsts) { + if (this.config.webUrl.startsWith('https') && !this.config.disableHsts) { fastify.addHook('onRequest', (request, reply, done) => { reply.header('strict-transport-security', 'max-age=15552000; preload'); done(); @@ -126,7 +126,7 @@ export class ServerService implements OnApplicationShutdown { } const effectiveLocation = process.env.NODE_ENV === 'production' ? location : location.replace(/^http:\/\//, 'https://'); - if (effectiveLocation.startsWith(`https://${this.config.host}/`)) { + if (effectiveLocation.startsWith(`https://${this.config.webHost}/`)) { done(); return; } @@ -216,7 +216,7 @@ export class ServerService implements OnApplicationShutdown { const user = await this.usersRepository.findOne({ where: { usernameLower: username.toLowerCase(), - host: (host == null) || (host === this.config.host) ? IsNull() : host, + host: (host == null) || (host === this.config.localHost) ? IsNull() : host, isSuspended: false, }, }); -- cgit v1.2.3-freya