Skip to content

Commit ebbeba4

Browse files
achingbrainJimbly
authored andcommitted
Add maxHeaderSize to types
Adds the `.maxHeaderSize` field to the types of the `HTTPParserJS` class, otherwise tsc complains that the field doesn't exist. Fixes this sort of thing: ```ts const parser = new HTTPParser('RESPONSE') parser.maxHeaderSize = 1024 * 1024 // error TS2339: Property 'maxHeaderSize' does not exist on type 'HTTPParserJS' ```
1 parent 9e5daea commit ebbeba4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

http-parser.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ declare class HTTPParserJS {
9292
[HTTPParser.kOnBody]: OnBodyParser
9393
[HTTPParser.kOnMessageComplete]: noop
9494

95+
/**
96+
* Max number of bytes that will be parsed as headers, 80kb by default
97+
* @default 81920
98+
*/
99+
maxHeaderSize: number
100+
95101
reinitialize: HTTPParserConstructor
96102
close: noop
97103
pause: noop

0 commit comments

Comments
 (0)