diff options
| author | Freya Murphy <freya@freyacat.org> | 2026-03-02 16:05:12 -0500 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2026-03-02 17:39:38 -0500 |
| commit | 284b87dae85a356dd543a03f81d12031b11f7554 (patch) | |
| tree | 5df602a3d98fbf9a8f457fab3d749707bfd89cde /packages/backend/src/server/ServerService.ts | |
| parent | merge: Release/2025.4.5 (!1258) (diff) | |
| download | sharkey-284b87dae85a356dd543a03f81d12031b11f7554.tar.gz sharkey-284b87dae85a356dd543a03f81d12031b11f7554.tar.bz2 sharkey-284b87dae85a356dd543a03f81d12031b11f7554.zip | |
split url into webUrl and localUrl (like mastodon)
Diffstat (limited to 'packages/backend/src/server/ServerService.ts')
| -rw-r--r-- | packages/backend/src/server/ServerService.ts | 6 |
1 files changed, 3 insertions, 3 deletions
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, }, }); |