diff --git a/packages/reverse-proxy-service/Dockerfile b/packages/reverse-proxy-service/Dockerfile index 5470da551..96fdc261f 100644 --- a/packages/reverse-proxy-service/Dockerfile +++ b/packages/reverse-proxy-service/Dockerfile @@ -20,4 +20,4 @@ COPY --from=builder $HOME/.env.example . EXPOSE 8080 -CMD ["node", "dist/index.js"] +CMD ["node", "--max-http-header-size=10485760", "dist/index.js"] diff --git a/packages/reverse-proxy-service/package.json b/packages/reverse-proxy-service/package.json index 30eb63664..92cef53ac 100644 --- a/packages/reverse-proxy-service/package.json +++ b/packages/reverse-proxy-service/package.json @@ -5,7 +5,7 @@ "main": "src/index.ts", "scripts": { "start": "npm run serve", - "serve": "node dist/index.js", + "serve": "node --max-http-header-size=10485760 dist/index.js", "dev": "nodemon", "prebuild": "rimraf dist", "build": "tsc", diff --git a/packages/reverse-proxy-service/src/server.ts b/packages/reverse-proxy-service/src/server.ts index deadb0996..c48d8e8fe 100644 --- a/packages/reverse-proxy-service/src/server.ts +++ b/packages/reverse-proxy-service/src/server.ts @@ -12,11 +12,6 @@ import store from './setup/store'; import { COOKIE_SECRET } from './setup/env'; import oidcAuth from './middleware/oidcAuth'; import { updateApplicationCache } from './utils/applicationCache'; -import http from 'http'; - -const MAX_HEADER_SIZE = 16 * 1024 * 1024; // 16MB - -( http.globalAgent as http.Agent ).maxHeaderSize = MAX_HEADER_SIZE; const getServer = async () => { const server = express(); diff --git a/packages/reverse-proxy-service/src/types/http.d.ts b/packages/reverse-proxy-service/src/types/http.d.ts deleted file mode 100644 index 3edfd5153..000000000 --- a/packages/reverse-proxy-service/src/types/http.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import * as http from 'http'; - -declare module 'http' { - interface Agent { - maxHeaderSize?: number; - } -} diff --git a/packages/reverse-proxy-service/tsconfig.json b/packages/reverse-proxy-service/tsconfig.json index 7a71c16aa..49a94af48 100644 --- a/packages/reverse-proxy-service/tsconfig.json +++ b/packages/reverse-proxy-service/tsconfig.json @@ -50,10 +50,7 @@ // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - "typeRoots": [ - "src/types", - "node_modules/@types" - ], + // "typeRoots": [], // "types": [], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */