From 701ad84e5be9f32f4da1165975f47069c7fc81fa Mon Sep 17 00:00:00 2001 From: Soumyadip Chowdhury Date: Mon, 9 Dec 2024 15:48:04 +0530 Subject: [PATCH] fix(reverse-proxy): increase request header size limit --- packages/reverse-proxy-service/src/server.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/reverse-proxy-service/src/server.ts b/packages/reverse-proxy-service/src/server.ts index c48d8e8fe..6395e2d27 100644 --- a/packages/reverse-proxy-service/src/server.ts +++ b/packages/reverse-proxy-service/src/server.ts @@ -12,6 +12,16 @@ 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'; +import https from 'https'; + +declare module 'http' { interface Agent { maxHeaderSize?: number; } } +declare module 'https' { interface Agent { maxHeaderSize?: number; } } + +const MAX_HEADER_SIZE = 16 * 1024 * 1024; // 16MB + +( http.globalAgent as http.Agent ).maxHeaderSize = MAX_HEADER_SIZE; +( https.globalAgent as https.Agent ).maxHeaderSize = MAX_HEADER_SIZE; const getServer = async () => { const server = express();