diff --git a/backend/Dockerfile b/backend/Dockerfile index 3d90d38..66f31d5 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -32,6 +32,6 @@ FROM node:18-alpine As production COPY --chown=node:node --from=build /usr/src/app/node_modules ./node_modules COPY --chown=node:node --from=build /usr/src/app/dist ./dist -CMD [ "node", "dist/index.js" ] +CMD [ "node", "dist/src/index.js" ] EXPOSE 80 \ No newline at end of file diff --git a/backend/src/header-adjustment.ts b/backend/src/header-adjustment.ts index 6eb874d..5d3ccb7 100644 --- a/backend/src/header-adjustment.ts +++ b/backend/src/header-adjustment.ts @@ -1,5 +1,6 @@ import { ConnectionDetails } from "./connection-details"; import { IncomingHttpHeaders } from "http"; +import { name, version } from "../package.json"; export class HeaderAdjustment { private static headersToRemove = ["authorization"]; @@ -12,6 +13,10 @@ export class HeaderAdjustment { continue; } + if (key.toLowerCase() === "user-agent") { + keysToAdd[key] = `${name}/${version}`; + } + if (!key.startsWith(this.headerPrefix)) { continue; } diff --git a/backend/tsconfig.json b/backend/tsconfig.json index b7ffa00..46addf8 100644 --- a/backend/tsconfig.json +++ b/backend/tsconfig.json @@ -13,7 +13,8 @@ "isolatedModules": false, "esModuleInterop": true, "skipLibCheck": true, - "strict": false + "strict": false, + "resolveJsonModule": true }, "include": ["**/*.d.ts", "**/*.ts"], "exclude": ["node_modules"]