diff --git a/src/Utilities.ts b/src/Utilities.ts index b8ff5e0..e86ce7e 100644 --- a/src/Utilities.ts +++ b/src/Utilities.ts @@ -28,11 +28,7 @@ export const FileListSchema = avsc.Type.forSchema({ }) export class Utilities { - public static got: Got = got.extend({ - headers: { - 'User-Agent': `93AtHome-V3/${Config.version}` - } - }); + public static got: Got = got; public static isRunningInDocker(): boolean { return process.env.IS_IN_DOCKER === 'true'; diff --git a/src/index.ts b/src/index.ts index e92f645..26a20d4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,6 +2,7 @@ import { exec } from "child_process"; import { Config } from './Config.js'; import { Server } from './Server.js'; import { Utilities } from './Utilities.js'; +import got from "got"; function onStop(signal: string) { server.db.close(); @@ -10,6 +11,11 @@ function onStop(signal: string) { } Config.init(); +Utilities.got = got.extend({ + headers: { + 'User-Agent': `93AtHome-V3/${Config.version}` + } +}); if (Utilities.isRunningInDocker()) { console.debug("Running in Docker container");