| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -60,11 +60,6 @@ typings/ | |||
| 60 | 60 | # next.js build output | |
| 61 | 61 | .next | |
| 62 | 62 | ||
| 63 | - # lock files | ||
| 64 | - package-lock.json | ||
| 65 | - yarn.lock | ||
| 66 | - pnpm-lock.yaml | ||
| 67 | - | ||
| 68 | 63 | # IDE files | |
| 69 | 64 | .idea | |
| 70 | 65 | .vscode | |
@@ -81,9 +76,6 @@ fuzz-results-*.json | |||
| 81 | 76 | undici-fetch.js | |
| 82 | 77 | /test/imports/undici-import.js | |
| 83 | 78 | ||
| 84 | - # .npmrc has platform specific value for windows | ||
| 85 | - .npmrc | ||
| 86 | - | ||
| 87 | 79 | .tap | |
| 88 | 80 | ||
| 89 | 81 | # File generated by /test/request-timeout.js | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + min-release-age=1 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,2 +1,161 @@ | |||
| 1 | - If you believe you have found a security issue in the software in this | ||
| 2 | - repository, please consult https://github.com/nodejs/node/blob/HEAD/SECURITY.md. | ||
| 1 | + # Security | ||
| 2 | + | ||
| 3 | + ## Reporting a vulnerability in undici | ||
| 4 | + | ||
| 5 | + Report security bugs in undici via | ||
| 6 | + [GitHub Security Advisories](https://github.com/nodejs/undici/security/advisories/new) | ||
| 7 | + or [HackerOne](https://hackerone.com/nodejs). | ||
| 8 | + | ||
| 9 | + Your report will normally be acknowledged within 5 days, and you will receive | ||
| 10 | + a more detailed response within 10 days indicating the next steps in handling | ||
| 11 | + your submission. These timelines may extend when our triage volunteers are | ||
| 12 | + away, particularly at the end of the year. | ||
| 13 | + | ||
| 14 | + After the initial reply to your report, the security team will endeavor to keep | ||
| 15 | + you informed of the progress being made towards a fix and full announcement, | ||
| 16 | + and may ask for additional information or guidance surrounding the reported | ||
| 17 | + issue. | ||
| 18 | + | ||
| 19 | + ## Disclosure policy | ||
| 20 | + | ||
| 21 | + * The security report is received and assigned a primary handler. The problem | ||
| 22 | + is validated against all supported versions of undici. Once confirmed, a list | ||
| 23 | + of all affected versions is determined. Code is audited to find any potential | ||
| 24 | + similar problems. Fixes are prepared for all supported releases. These fixes | ||
| 25 | + are not committed to the public repository but rather held locally pending | ||
| 26 | + the announcement. | ||
| 27 | + | ||
| 28 | + * Because undici is bundled into Node.js, security releases are often | ||
| 29 | + coordinated with the Node.js project to avoid leaving Node.js users | ||
| 30 | + vulnerable. As a result, fixed versions of undici are published to npm | ||
| 31 | + before the corresponding CVE is disclosed, since the CVE will only be | ||
| 32 | + published after the coordinated Node.js release. This delay is typically | ||
| 33 | + a few days but can take up to a week. | ||
| 34 | + | ||
| 35 | + ## The undici threat model | ||
| 36 | + | ||
| 37 | + Undici is an HTTP client library for Node.js. Its threat model is derived from | ||
| 38 | + and aligned with the [Node.js threat model](https://github.com/nodejs/node/blob/HEAD/SECURITY.md#the-nodejs-threat-model). | ||
| 39 | + | ||
| 40 | + ### What constitutes a vulnerability | ||
| 41 | + | ||
| 42 | + Being able to cause the following through control of the elements that undici | ||
| 43 | + does not trust is considered a vulnerability: | ||
| 44 | + | ||
| 45 | + * Disclosure or loss of integrity or confidentiality of data protected through | ||
| 46 | + the correct use of undici APIs. | ||
| 47 | + * The unavailability of the runtime, including the unbounded degradation of its | ||
| 48 | + performance. | ||
| 49 | + | ||
| 50 | + #### Denial of Service (DoS) vulnerabilities | ||
| 51 | + | ||
| 52 | + For a behavior to be considered a DoS vulnerability, the proof of concept must | ||
| 53 | + meet the following criteria: | ||
| 54 | + | ||
| 55 | + * The API is being correctly used. | ||
| 56 | + * The API is public and documented. | ||
| 57 | + * The behavior is significant enough to cause a denial of service quickly | ||
| 58 | + or in a context not controlled by the application developer (for example, | ||
| 59 | + HTTP parsing). | ||
| 60 | + * The behavior is directly exploitable by an untrusted source without requiring | ||
| 61 | + application mistakes. | ||
| 62 | + * The behavior cannot be reasonably mitigated through standard operational | ||
| 63 | + practices (like process recycling). | ||
| 64 | + * The attack demonstrates | ||
| 65 | + [asymmetric resource consumption](https://cwe.mitre.org/data/definitions/405.html), | ||
| 66 | + where the attacker expends significantly fewer resources than what is required | ||
| 67 | + by the client to process the attack. | ||
| 68 | + | ||
| 69 | + **Undici does NOT trust**: | ||
| 70 | + | ||
| 71 | + * Data received from the remote end of HTTP connections (both inbound responses | ||
| 72 | + and server-sent data) that is parsed or transformed by undici before being | ||
| 73 | + passed to the application. This includes: | ||
| 74 | + * HTTP response headers and status lines. | ||
| 75 | + * HTTP response bodies when processed by undici (e.g., chunked transfer | ||
| 76 | + decoding, content-encoding). | ||
| 77 | + * WebSocket frames received from a server. | ||
| 78 | + * Server-Sent Events (EventSource) data received from a server. | ||
| 79 | + * TLS certificate validation performed by undici on behalf of the application. | ||
| 80 | + | ||
| 81 | + **Undici trusts**: | ||
| 82 | + | ||
| 83 | + * The application code that uses its APIs, including all configuration, | ||
| 84 | + options, and callbacks provided by the application. | ||
| 85 | + * The operating system and its network stack. | ||
| 86 | + * The Node.js runtime undici is running on. | ||
| 87 | + * Dependencies installed by the application. | ||
| 88 | + * The DNS resolution results provided by the operating system or configured | ||
| 89 | + resolvers. | ||
| 90 | + | ||
| 91 | + In other words, if untrusted data passing through undici to the application | ||
| 92 | + can trigger actions other than those documented for the APIs, there is likely | ||
| 93 | + a security vulnerability. Examples of unwanted actions are polluting globals, | ||
| 94 | + causing an unrecoverable crash, or any other unexpected side effects that can | ||
| 95 | + lead to a loss of confidentiality, integrity, or availability. | ||
| 96 | + | ||
| 97 | + ### Examples of vulnerabilities | ||
| 98 | + | ||
| 99 | + #### Improper Certificate Validation (CWE-295) | ||
| 100 | + | ||
| 101 | + * Undici provides TLS connections to HTTPS endpoints. If certificates can be | ||
| 102 | + crafted that result in incorrect validation by undici, that is considered | ||
| 103 | + a vulnerability. | ||
| 104 | + | ||
| 105 | + #### Inconsistent Interpretation of HTTP Responses (CWE-444) | ||
| 106 | + | ||
| 107 | + * Undici parses HTTP responses received from servers. Bugs in parsing response | ||
| 108 | + headers or transfer encoding which can result in response smuggling or | ||
| 109 | + desynchronization are considered vulnerabilities. | ||
| 110 | + | ||
| 111 | + #### HTTP Request Smuggling (CWE-444) | ||
| 112 | + | ||
| 113 | + * Bugs that allow crafting requests that are interpreted differently by undici | ||
| 114 | + and an upstream server, leading to request smuggling, are considered | ||
| 115 | + vulnerabilities. | ||
| 116 | + | ||
| 117 | + #### CRLF Injection in Request Headers (CWE-93) | ||
| 118 | + | ||
| 119 | + * If untrusted input passed to undici APIs (such as header values or URLs) | ||
| 120 | + can inject additional headers or corrupt the HTTP request stream, that is | ||
| 121 | + considered a vulnerability. | ||
| 122 | + | ||
| 123 | + ### Examples of non-vulnerabilities | ||
| 124 | + | ||
| 125 | + #### Malicious Third-Party Modules (CWE-1357) | ||
| 126 | + | ||
| 127 | + * Application code and its dependencies are trusted by undici. Any scenario | ||
| 128 | + that requires a malicious third-party module cannot result in a vulnerability | ||
| 129 | + in undici. | ||
| 130 | + | ||
| 131 | + #### Prototype Pollution Attacks (CWE-1321) | ||
| 132 | + | ||
| 133 | + * Undici trusts the inputs provided to it by application code. It is up to the | ||
| 134 | + application to sanitize appropriately. Any scenario that requires control | ||
| 135 | + over user input passed directly by the application is not considered a | ||
| 136 | + vulnerability in undici. | ||
| 137 | + | ||
| 138 | + #### Uncontrolled Resource Consumption on Outbound Connections (CWE-400) | ||
| 139 | + | ||
| 140 | + * If undici is asked to connect to a remote site and the response payload is | ||
| 141 | + large enough to impact performance or cause the runtime to run out of | ||
| 142 | + resources, that is not considered a vulnerability. Applications are | ||
| 143 | + responsible for setting appropriate limits on response sizes. | ||
| 144 | + | ||
| 145 | + #### Application Misconfiguration | ||
| 146 | + | ||
| 147 | + * Issues arising from incorrect or insecure use of undici APIs (such as | ||
| 148 | + disabling TLS verification, ignoring errors, or passing unsanitized user | ||
| 149 | + input to request options) are the application's responsibility, not | ||
| 150 | + vulnerabilities in undici. | ||
| 151 | + | ||
| 152 | + ## Receiving security updates | ||
| 153 | + | ||
| 154 | + Security notifications will be distributed via | ||
| 155 | + [GitHub Security Advisories](https://github.com/nodejs/undici/security/advisories). | ||
| 156 | + | ||
| 157 | + ## Comments on this policy | ||
| 158 | + | ||
| 159 | + If you have suggestions on how this process could be improved, please open an | ||
| 160 | + issue on the [nodejs/undici](https://github.com/nodejs/undici/issues) | ||
| 161 | + repository or file a pull request. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | 5 | #define LLHTTP_VERSION_MAJOR 9 | |
| 6 | 6 | #define LLHTTP_VERSION_MINOR 3 | |
| 7 | - #define LLHTTP_VERSION_PATCH 0 | ||
| 7 | + #define LLHTTP_VERSION_PATCH 1 | ||
| 8 | 8 | ||
| 9 | 9 | #ifndef INCLUDE_LLHTTP_ITSELF_H_ | |
| 10 | 10 | #define INCLUDE_LLHTTP_ITSELF_H_ | |
@@ -58,10 +58,8 @@ enum llhttp_errno { | |||
| 58 | 58 | HPE_OK = 0, | |
| 59 | 59 | HPE_INTERNAL = 1, | |
| 60 | 60 | HPE_STRICT = 2, | |
| 61 | - HPE_CR_EXPECTED = 25, | ||
| 62 | 61 | HPE_LF_EXPECTED = 3, | |
| 63 | 62 | HPE_UNEXPECTED_CONTENT_LENGTH = 4, | |
| 64 | - HPE_UNEXPECTED_SPACE = 30, | ||
| 65 | 63 | HPE_CLOSED_CONNECTION = 5, | |
| 66 | 64 | HPE_INVALID_METHOD = 6, | |
| 67 | 65 | HPE_INVALID_URL = 7, | |
@@ -82,15 +80,17 @@ enum llhttp_errno { | |||
| 82 | 80 | HPE_PAUSED_UPGRADE = 22, | |
| 83 | 81 | HPE_PAUSED_H2_UPGRADE = 23, | |
| 84 | 82 | HPE_USER = 24, | |
| 83 | + HPE_CR_EXPECTED = 25, | ||
| 85 | 84 | HPE_CB_URL_COMPLETE = 26, | |
| 86 | 85 | HPE_CB_STATUS_COMPLETE = 27, | |
| 87 | - HPE_CB_METHOD_COMPLETE = 32, | ||
| 88 | - HPE_CB_VERSION_COMPLETE = 33, | ||
| 89 | 86 | HPE_CB_HEADER_FIELD_COMPLETE = 28, | |
| 90 | 87 | HPE_CB_HEADER_VALUE_COMPLETE = 29, | |
| 88 | + HPE_UNEXPECTED_SPACE = 30, | ||
| 89 | + HPE_CB_RESET = 31, | ||
| 90 | + HPE_CB_METHOD_COMPLETE = 32, | ||
| 91 | + HPE_CB_VERSION_COMPLETE = 33, | ||
| 91 | 92 | HPE_CB_CHUNK_EXTENSION_NAME_COMPLETE = 34, | |
| 92 | 93 | HPE_CB_CHUNK_EXTENSION_VALUE_COMPLETE = 35, | |
| 93 | - HPE_CB_RESET = 31, | ||
| 94 | 94 | HPE_CB_PROTOCOL_COMPLETE = 38 | |
| 95 | 95 | }; | |
| 96 | 96 | typedef enum llhttp_errno llhttp_errno_t; | |
@@ -294,10 +294,8 @@ typedef enum llhttp_status llhttp_status_t; | |||
| 294 | 294 | XX(0, OK, OK) \ | |
| 295 | 295 | XX(1, INTERNAL, INTERNAL) \ | |
| 296 | 296 | XX(2, STRICT, STRICT) \ | |
| 297 | - XX(25, CR_EXPECTED, CR_EXPECTED) \ | ||
| 298 | 297 | XX(3, LF_EXPECTED, LF_EXPECTED) \ | |
| 299 | 298 | XX(4, UNEXPECTED_CONTENT_LENGTH, UNEXPECTED_CONTENT_LENGTH) \ | |
| 300 | - XX(30, UNEXPECTED_SPACE, UNEXPECTED_SPACE) \ | ||
| 301 | 299 | XX(5, CLOSED_CONNECTION, CLOSED_CONNECTION) \ | |
| 302 | 300 | XX(6, INVALID_METHOD, INVALID_METHOD) \ | |
| 303 | 301 | XX(7, INVALID_URL, INVALID_URL) \ | |
@@ -318,15 +316,17 @@ typedef enum llhttp_status llhttp_status_t; | |||
| 318 | 316 | XX(22, PAUSED_UPGRADE, PAUSED_UPGRADE) \ | |
| 319 | 317 | XX(23, PAUSED_H2_UPGRADE, PAUSED_H2_UPGRADE) \ | |
| 320 | 318 | XX(24, USER, USER) \ | |
| 319 | + XX(25, CR_EXPECTED, CR_EXPECTED) \ | ||
| 321 | 320 | XX(26, CB_URL_COMPLETE, CB_URL_COMPLETE) \ | |
| 322 | 321 | XX(27, CB_STATUS_COMPLETE, CB_STATUS_COMPLETE) \ | |
| 323 | - XX(32, CB_METHOD_COMPLETE, CB_METHOD_COMPLETE) \ | ||
| 324 | - XX(33, CB_VERSION_COMPLETE, CB_VERSION_COMPLETE) \ | ||
| 325 | 322 | XX(28, CB_HEADER_FIELD_COMPLETE, CB_HEADER_FIELD_COMPLETE) \ | |
| 326 | 323 | XX(29, CB_HEADER_VALUE_COMPLETE, CB_HEADER_VALUE_COMPLETE) \ | |
| 324 | + XX(30, UNEXPECTED_SPACE, UNEXPECTED_SPACE) \ | ||
| 325 | + XX(31, CB_RESET, CB_RESET) \ | ||
| 326 | + XX(32, CB_METHOD_COMPLETE, CB_METHOD_COMPLETE) \ | ||
| 327 | + XX(33, CB_VERSION_COMPLETE, CB_VERSION_COMPLETE) \ | ||
| 327 | 328 | XX(34, CB_CHUNK_EXTENSION_NAME_COMPLETE, CB_CHUNK_EXTENSION_NAME_COMPLETE) \ | |
| 328 | 329 | XX(35, CB_CHUNK_EXTENSION_VALUE_COMPLETE, CB_CHUNK_EXTENSION_VALUE_COMPLETE) \ | |
| 329 | - XX(31, CB_RESET, CB_RESET) \ | ||
| 330 | 330 | XX(38, CB_PROTOCOL_COMPLETE, CB_PROTOCOL_COMPLETE) \ | |
| 331 | 331 | ||
| 332 | 332 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,7 +10,7 @@ | |||
| 10 | 10 | #endif /* _MSC_VER */ | |
| 11 | 11 | #endif /* __SSE4_2__ */ | |
| 12 | 12 | ||
| 13 | - #ifdef __ARM_NEON__ | ||
| 13 | + #if defined(__ARM_NEON__) || defined(__ARM_NEON) | ||
| 14 | 14 | #include <arm_neon.h> | |
| 15 | 15 | #endif /* __ARM_NEON__ */ | |
| 16 | 16 | ||
@@ -1542,7 +1542,7 @@ static llparse_state_t llhttp__internal__run( | |||
| 1542 | 1542 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 1543 | 1543 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, | |
| 1544 | 1544 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 1545 | - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
| 1545 | + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, | ||
| 1546 | 1546 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 1547 | 1547 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 1548 | 1548 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
@@ -2625,7 +2625,7 @@ static llparse_state_t llhttp__internal__run( | |||
| 2625 | 2625 | goto s_n_llhttp__internal__n_header_value_otherwise; | |
| 2626 | 2626 | } | |
| 2627 | 2627 | #endif /* __SSE4_2__ */ | |
| 2628 | - #ifdef __ARM_NEON__ | ||
| 2628 | + #if defined(__ARM_NEON__) || defined(__ARM_NEON) | ||
| 2629 | 2629 | while (endp - p >= 16) { | |
| 2630 | 2630 | uint8x16_t input; | |
| 2631 | 2631 | uint8x16_t single; | |
@@ -2639,19 +2639,23 @@ static llparse_state_t llhttp__internal__run( | |||
| 2639 | 2639 | /* Find first character that does not match `ranges` */ | |
| 2640 | 2640 | single = vceqq_u8(input, vdupq_n_u8(0x9)); | |
| 2641 | 2641 | mask = single; | |
| 2642 | - single = vandq_u16( | ||
| 2642 | + single = vandq_u8( | ||
| 2643 | 2643 | vcgeq_u8(input, vdupq_n_u8(' ')), | |
| 2644 | 2644 | vcleq_u8(input, vdupq_n_u8('~')) | |
| 2645 | 2645 | ); | |
| 2646 | - mask = vorrq_u16(mask, single); | ||
| 2647 | - single = vandq_u16( | ||
| 2646 | + mask = vorrq_u8(mask, single); | ||
| 2647 | + single = vandq_u8( | ||
| 2648 | 2648 | vcgeq_u8(input, vdupq_n_u8(0x80)), | |
| 2649 | 2649 | vcleq_u8(input, vdupq_n_u8(0xff)) | |
| 2650 | 2650 | ); | |
| 2651 | - mask = vorrq_u16(mask, single); | ||
| 2652 | - narrow = vshrn_n_u16(mask, 4); | ||
| 2651 | + mask = vorrq_u8(mask, single); | ||
| 2652 | + narrow = vshrn_n_u16(vreinterpretq_u16_u8(mask), 4); | ||
| 2653 | 2653 | match_mask = ~vget_lane_u64(vreinterpret_u64_u8(narrow), 0); | |
| 2654 | - match_len = __builtin_ctzll(match_mask) >> 2; | ||
| 2654 | + if (match_mask == 0) { | ||
| 2655 | + match_len = 16; | ||
| 2656 | + } else { | ||
| 2657 | + match_len = __builtin_ctzll(match_mask) >> 2; | ||
| 2658 | + } | ||
| 2655 | 2659 | if (match_len != 16) { | |
| 2656 | 2660 | p += match_len; | |
| 2657 | 2661 | goto s_n_llhttp__internal__n_header_value_otherwise; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1354,10 +1354,10 @@ Emitted when dispatcher is no longer busy. | |||
| 1354 | 1354 | ||
| 1355 | 1355 | ## Parameter: `UndiciHeaders` | |
| 1356 | 1356 | ||
| 1357 | - * `Record<string, string | string[] | undefined> | string[] | Iterable<[string, string | string[] | undefined]> | null` | ||
| 1357 | + * `Record<string, number | string | string[] | undefined> | string[] | Iterable<[string, string | string[] | undefined]> | null` | ||
| 1358 | 1358 | ||
| 1359 | 1359 | Header arguments such as `options.headers` in [`Client.dispatch`](/docs/docs/api/Client.md#clientdispatchoptions-handlers) can be specified in three forms: | |
| 1360 | - * As an object specified by the `Record<string, string | string[] | undefined>` (`IncomingHttpHeaders`) type. | ||
| 1360 | + * As an object specified by the `Record<string, number | string | string[] | undefined>` (`OutgoingHttpHeaders`) type. | ||
| 1361 | 1361 | * As an array of strings. An array representation of a header list must have an even length, or an `InvalidArgumentError` will be thrown. | |
| 1362 | 1362 | * As an iterable that can encompass `Headers`, `Map`, or a custom iterator returning key-value pairs. | |
| 1363 | 1363 | Keys are lowercase and values are not modified. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -60,7 +60,7 @@ class ConnectHandler extends AsyncResource { | |||
| 60 | 60 | // Indicates is an HTTP2Session | |
| 61 | 61 | if (responseHeaders != null) { | |
| 62 | 62 | responseHeaders = this.responseHeaders === 'raw' | |
| 63 | - ? (Array.isArray(rawHeaders) ? util.parseRawHeaders(rawHeaders) : []) | ||
| 63 | + ? util.parseRawHeaders(rawHeaders) | ||
| 64 | 64 | : headers | |
| 65 | 65 | } | |
| 66 | 66 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -167,7 +167,7 @@ class PipelineHandler extends AsyncResource { | |||
| 167 | 167 | if (this.onInfo) { | |
| 168 | 168 | const rawHeaders = controller?.rawHeaders | |
| 169 | 169 | const responseHeaders = this.responseHeaders === 'raw' | |
| 170 | - ? (Array.isArray(rawHeaders) ? util.parseRawHeaders(rawHeaders) : []) | ||
| 170 | + ? util.parseRawHeaders(rawHeaders) | ||
| 171 | 171 | : headers | |
| 172 | 172 | this.onInfo({ statusCode, headers: responseHeaders }) | |
| 173 | 173 | } | |
@@ -181,7 +181,7 @@ class PipelineHandler extends AsyncResource { | |||
| 181 | 181 | this.handler = null | |
| 182 | 182 | const rawHeaders = controller?.rawHeaders | |
| 183 | 183 | const responseHeaders = this.responseHeaders === 'raw' | |
| 184 | - ? (Array.isArray(rawHeaders) ? util.parseRawHeaders(rawHeaders) : []) | ||
| 184 | + ? util.parseRawHeaders(rawHeaders) | ||
| 185 | 185 | : headers | |
| 186 | 186 | body = this.runInAsyncScope(handler, null, { | |
| 187 | 187 | statusCode, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,7 +21,7 @@ class RequestHandler extends AsyncResource { | |||
| 21 | 21 | throw new InvalidArgumentError('invalid callback') | |
| 22 | 22 | } | |
| 23 | 23 | ||
| 24 | - if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) { | ||
| 24 | + if (highWaterMark != null && (!Number.isFinite(highWaterMark) || highWaterMark < 0)) { | ||
| 25 | 25 | throw new InvalidArgumentError('invalid highWaterMark') | |
| 26 | 26 | } | |
| 27 | 27 | ||
@@ -92,7 +92,7 @@ class RequestHandler extends AsyncResource { | |||
| 92 | 92 | ||
| 93 | 93 | const rawHeaders = controller?.rawHeaders | |
| 94 | 94 | const responseHeaderData = responseHeaders === 'raw' | |
| 95 | - ? (Array.isArray(rawHeaders) ? util.parseRawHeaders(rawHeaders) : []) | ||
| 95 | + ? util.parseRawHeaders(rawHeaders) | ||
| 96 | 96 | : headers | |
| 97 | 97 | ||
| 98 | 98 | if (statusCode < 200) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -85,7 +85,7 @@ class StreamHandler extends AsyncResource { | |||
| 85 | 85 | ||
| 86 | 86 | const rawHeaders = controller?.rawHeaders | |
| 87 | 87 | const responseHeaderData = responseHeaders === 'raw' | |
| 88 | - ? (Array.isArray(rawHeaders) ? util.parseRawHeaders(rawHeaders) : []) | ||
| 88 | + ? util.parseRawHeaders(rawHeaders) | ||
| 89 | 89 | : headers | |
| 90 | 90 | ||
| 91 | 91 | if (statusCode < 200) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments