Ran
|
Jobs
1
|
Files
12
|
Run time
2s
|
Badge
Embed ▾
README BADGES
|
push
travis-ci
<a href="https://github.com/nock/nock/commit/<a class=hub.com/nock/nock/commit/b687592c4e2103ac88a7f813b7e1019264e48d01">b687592c4<a href="https://github.com/nock/nock/commit/b687592c4e2103ac88a7f813b7e1019264e48d01">">feat(reply): Response headers to more closely match Node&#39;s functionality. (#1564) * Response headers to more closely match Node. Updates the header handling in the `Interceptor` and `RequestOverrider` with the intention of mimicking the native behavior of `http.IncomingMessage.rawHeaders`. &gt; The raw request/response headers list exactly as they were received. There are three fundamental changes in this changeset: 1) Header Input Type Previously, headers could be provided to: - `Scope.defaultReplyHeaders` as a plain object - `Interceptor.reply(status, body, headers)` as a plain object or an array of raw headers - `Interceptor.reply(() =&gt; [status, body, headers]` as a plain object Now, all three allow consistent inputs where the headers can be provided as a plain object, an array of raw headers, or a `Map`. 2) Duplicate Headers Folding This change deviates from the suggested guidelines laid out in #1553 because those guidelines didn&#39;t properly handle duplicate headers, especially when some are defined as defaults. This change was modeled to duplicate [Node&#39;s implementation](https://github.com/nodejs/node/blob/</a><a class="double-link" href="https://github.com/nock/nock/commit/<a class="double-link" href="https://github.com/nock/nock/commit/908292cf1f551c614a733d858528ffb13fb3a524">908292cf1</a>">908292cf1</a><a href="https://github.com/nock/nock/commit/b687592c4e2103ac88a7f813b7e1019264e48d01">/lib/_http_incoming.js#L245) ([relevant docs](https://nodejs.org/api/http.html#http_message_headers)). It specifically lays out how duplicate headers are handled depending on the field name. In the case of default headers, they are not included on the `Response` (not even in the raw headers) if the field name exists in the reply headers (using a case-insensitive comparison). 3) Raw Headers are the Source of Truth Previously, the `Interceptor` and `RequestOverrider` mostly keep track of header... (continued)
793 of 828 branches covered (95.77%)
Branch coverage included in aggregate %.
1466 of 1485 relevant lines covered (98.72%)
190.56 hits per line
ID | Job ID | Ran | Files | Coverage | |
---|---|---|---|---|---|
4 | 3314.4 | 12 |
97.67 |
Travis Job 3314.4 |
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
---|