Skip to content

Commit e2dcd2e

Browse files
committed
Use --insecure-http-parser to avoid issues with bad upstream responses
Previously, the server used the strict HTTP parser (introduced in Node v12 I think?) which intentionally aggresively rejects responses that don't strictly follow the rules, to avoid request smuggling. In our case, we want to allow request smuggling: the response we forward should *exactly* match the response we receive, wherever possible, even if the response was stupid.
1 parent 1da9f0b commit e2dcd2e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,10 @@ if (!amMainInstance) {
363363
NODE_SKIP_PLATFORM_CHECK: '1',
364364
NODE_OPTIONS:
365365
process.env.HTTPTOOLKIT_NODE_OPTIONS || // Allow manually configuring node options
366-
"--max-http-header-size=102400" // By default, set max header size to 100KB
366+
[
367+
"--max-http-header-size=102400", // By default, set max header size to 100KB
368+
"--insecure-http-parser" // Allow invalid HTTP, e.g. header values - we'd rather be invisible than strict
369+
].join(' ')
367370
})
368371
});
369372

0 commit comments

Comments
 (0)