Commit dc71a3b
feat(request_overrider): Set
`ClientMessage.socket` is an instance of our `socket` class. As that class’ constructor sets `authorized` to `true` on `https` requests, the code here that sets `response.socket.authorized` is pointless.
`ClientMessage.client` was deprecated in iojs 2.2 and per request/request#1615 but is still aliased: https://github.com/nodejs/node/blob/2e613a9c301165d121b19b86e382860323abc22f/lib/_http_incoming.js#L67
The old code, which sets `response.client.authorized`, is being replaced with new code which aliases `response.client`. This ensures that `response.client` and `response.socket` point to the same thing, which provides parity with a non-overridden request. This may help with compatibility with libraries which depend on that undocumented property, such as some very old versions of `request`.
This also ensures that `response.client.authorized` remains set, without needing to set it directly.
This is being changed now to remove two bits of unreachable code in the conditional.IncomingMessage.client for parity with real requests1 parent 6d2a312 commit dc71a3b
3 files changed
+13
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
471 | 471 | | |
472 | 472 | | |
473 | 473 | | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3828 | 3828 | | |
3829 | 3829 | | |
3830 | 3830 | | |
| 3831 | + | |
3831 | 3832 | | |
3832 | 3833 | | |
3833 | 3834 | | |
| |||
0 commit comments