Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(reverse-proxy): increase request header size limit #1770

Merged
merged 3 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading