Skip to content

Commit

Permalink
fix(reverse-proxy): increase request header size limit (#1770)
Browse files Browse the repository at this point in the history
  • Loading branch information
riginoommen authored Dec 10, 2024
2 parents e876d73 + 8e6e217 commit 455a0a1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/reverse-proxy-service/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ 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();
Expand Down
7 changes: 7 additions & 0 deletions packages/reverse-proxy-service/src/types/http.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as http from 'http';

declare module 'http' {
interface Agent {
maxHeaderSize?: number;
}
}
5 changes: 4 additions & 1 deletion packages/reverse-proxy-service/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@
// "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": [], /* List of folders to include type definitions from. */
"typeRoots": [
"src/types",
"node_modules/@types"
],
// "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'. */
Expand Down

0 comments on commit 455a0a1

Please sign in to comment.