Hackzzila
564048dc29
http,https,tls: switch to WHATWG URL parser
...
This switches the url parser from `url.parse()` to the WHATWG URL
parser while keeping `url.parse()` as fallback.
Also add tests for invalid url deprecations and correct hostname
checks.
PR-URL: https://github.com/nodejs/node/pull/20270
Fixes: https://github.com/nodejs/node/issues/19468
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2018-04-29 17:03:16 +02:00
Robert Nagy
d5e363b77e
http: added aborted property to request
...
PR-URL: https://github.com/nodejs/node/pull/20094
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2018-04-26 19:38:27 +02:00
Anatoli Papirovski
58e0800b81
http: cleanup parser properties
...
Cleanup constructor and freeParser to manage all existing parser
properties, not just some.
PR-URL: https://github.com/nodejs/node/pull/20126
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2018-04-23 15:59:27 +02:00
Anatoli Papirovski
f7fbbeedc6
http: relax requirements on upgrade listener
...
The http spec does not say anything about Upgrade headers making
protocol switch mandatory but Node.js implements them as if they
are. Relax the requirements to only destroy the socket if no
upgrade listener exists on the client when status code is 101.
PR-URL: https://github.com/nodejs/node/pull/19981
Fixes: https://github.com/nodejs/node/issues/11552
Refs: https://tools.ietf.org/html/rfc7230#section-6.7
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2018-04-16 11:02:23 +02:00
XadillaX
b06f686f88
http: fix request when setHost is true
...
Fixes: https://github.com/nodejs/node/issues/19457
PR-URL: https://github.com/nodejs/node/pull/19502
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Yuta Hiroto <hello@hiroppy.me >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2018-04-03 15:43:40 -07:00
Weijia Wang
254058109f
tools: add 'spaced-comment' into eslint rules
...
PR-URL: https://github.com/nodejs/node/pull/19596
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
2018-04-01 22:33:13 +08:00
Ruben Bridgewater
b38c81cb44
lib: improve error handling
...
This improves the error handling for a couple cases where the
received value would not have been handled so far or where the name
is wrong etc.
PR-URL: https://github.com/nodejs/node/pull/19445
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2018-03-25 03:01:45 +02:00
Michaël Zasso
6a9f049968
tools,lib: forbid native Error constructors
...
This adds a rule that forbids the use of native Error constructors in
the `lib` directory. This is to encourage use of the `internal/errors`
mechanism. The rule is disabled for errors that are not created with
the `internal/errors` module but are still assigned an error code.
PR-URL: https://github.com/nodejs/node/pull/19373
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-03-21 20:15:33 +01:00
Anatoli Papirovski
4d074343dd
async_hooks,process: remove internalNextTick
...
Instead of having mostly duplicate code in form of internalNextTick,
instead use the existing defaultAsyncTriggerIdScope with a slight
modification which allows undefined triggerAsyncId to be passed in,
which then just triggers the callback with the provided arguments.
PR-URL: https://github.com/nodejs/node/pull/19147
Refs: https://github.com/nodejs/node/issues/19104
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Andreas Madsen <amwebdk@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2018-03-08 13:23:44 +01:00
Michaël Zasso
1d2fd8b65b
lib: port remaining errors to new system
...
PR-URL: https://github.com/nodejs/node/pull/19137
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2018-03-07 14:54:38 +01:00
Anna Henningsen
648d668fcc
http: emit timeout duration overflow warning sync
...
Emit the `TimeoutOverflowWarning` synchronously, even when
still connecting, to get a better stack trace.
With thanks to Anatoli Papirovski for providing helpful
tips when writing the test.
PR-URL: https://github.com/nodejs/node/pull/18906
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-03-04 21:55:21 +00:00
Glen Keane
30fd3d25df
src: Remove lttng support.
...
This cleans up and removes lttng support completely. Recent discussion
on a PR to deprecate lttng suggested that we remove it completely
pending feedback from the TSC.
This should be considered a non breaking change, as a recent PR reveals
that compiling with this system has been broken for nearly two years.
Refs: https://github.com/nodejs/node/issues/18971
Refs: https://github.com/nodejs/node/pull/18975
Refs: https://github.com/nodejs/node/pull/18945
PR-URL: https://github.com/nodejs/node/pull/18982
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Jackson Tian <shyvo1987@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-03-01 16:44:43 +00:00
Andrew Johnston
1980a36dd4
http: prevent aborted event when already completed
...
When socket is closed on a response for a request that is being piped to
a stream there is a condition where aborted event will be fired to http
client when socket is closing and the incomingMessage stream is still
set to readable.
We need a check for request being complete and to only raise the
'aborted' event on the http client if we have not yet completed reading
the response from the server.
Fixes: https://github.com/nodejs/node/issues/18756
PR-URL: https://github.com/nodejs/node/pull/18999
Reviewed-By: Shingo Inoue <leko.noor@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-03-02 01:07:41 +09:00
Luigi Pinca
2b7f920e26
http: remove default 'drain' listener on upgrade
...
Ensure that the default `'drain'` listener is removed before the
`'connect'` or `'upgrade'` event is emitted.
PR-URL: https://github.com/nodejs/node/pull/18866
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2018-02-22 15:51:25 +00:00
Miles Elam
baf8495078
http: process 100, 102-199 according to specs.
...
Adding ServerResponse.writeProcessing to send 102 status codes.
Added an `'information'` event to ClientRequest to handle
1xx status codes except 101 Upgrade.
101 Upgrade is excluded due to its non-informational
processing according to RFC7231, Section 6.2.2.
This affects several modules downstream that use the http
module, e.g., node-fetch, all of whom violate HTTP RFCs
due to this module. As such, this could introduce a
breaking change for downstream if HTTP standards were
ignored in an ad-hoc fashion.
See also RFC2518 RFC8297.
PR-URL: https://github.com/nodejs/node/pull/18033
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
2018-02-15 11:57:57 +01:00
Anatoli Papirovski
7020bc6e07
http: remove domain specific code
...
Due to some changes to async tracking of http and also
in how domains are handled, it's no longer necessary
to manually copy domain from req to res in http code.
PR-URL: https://github.com/nodejs/node/pull/18477
Refs: https://github.com/nodejs/node/pull/16222
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Khaidi Chu <i@2333.moe >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
2018-02-04 08:23:26 -05:00
Rod Vagg
4404c7619b
http: process headers after setting up agent
...
Added tests to clarify the implicit behaviour of array header setting vs
object header setting
PR-URL: https://github.com/nodejs/node/pull/16568
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2018-02-01 10:28:58 +01:00
leeseean
5164a12618
http: use strict comparison
...
PR-URL: https://github.com/nodejs/node/pull/17011
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
2018-01-21 02:58:37 +01:00
Luigi Pinca
93f1d9e10b
http: free the parser before emitting 'upgrade'
...
Ensure that the parser is freed before emitting the 'connect' or
'upgrade' event.
PR-URL: https://github.com/nodejs/node/pull/18209
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Jon Moss <me@jonathanmoss.me >
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2018-01-21 02:42:19 +01:00
Ben Noordhuis
de4600ea2b
http: fix parsing of binary upgrade response body
...
Fix a bug where a connection upgrade response with a Transfer-Encoding
header and a body whose first byte is > 127 causes said byte to be
dropped on the floor when passing the remainder of the message to
the 'upgrade' event listeners.
Fixes: https://github.com/nodejs/node/issues/17789
PR-URL: https://github.com/nodejs/node/pull/17806
Fixes: https://github.com/nodejs/node/issues/17789
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2018-01-21 01:50:56 +01:00
Andreas Madsen
f3f1a9349a
async_hooks: rename initTriggerId
...
rename initTriggerId to defaultTriggerAsyncId such it matches the rest
of our naming.
PR-URL: https://github.com/nodejs/node/pull/17273
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-12-19 18:04:43 +01:00
Calvin Metcalf
e20af3371b
stream: add flow and buffer properties to streams
...
This adds computed properties to readable and writable streams to
allow access to the readable buffer, the writable buffer, and flow
state without accessing the readable or writable state.
These are the only uses of readable and writable state in the docs
so adding these work arounds allows them to be removed from the docs.
This also updates net, http_client and http_server to use the new
methods instead of manipulating readable and writable state directly.
See: https://github.com/nodejs/node/issues/445
PR-URL: https://github.com/nodejs/node/pull/12855
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-12-15 23:05:45 +01:00
Benno Fünfstück
b961d9fd83
http: disallow two-byte characters in URL path
...
This commit changes node's handling of two-byte characters in
the path component of an http URL. Previously, node would just
strip the higher byte when generating the request. So this code:
```
http.request({host: "example.com", port: "80", "/N"})
```
would request `http://example.com/ .`
(`.` is the character for the byte `0x2e`).
This is not useful and can in some cases lead to filter evasion.
With this change, the code generates `ERR_UNESCAPED_CHARACTERS`,
just like space and control characters already did.
PR-URL: https://github.com/nodejs/node/pull/16237
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
2017-12-12 12:30:12 -02:00
Vijayalakshmi Kannan
a0aff57c5a
lib: replace string concatenation with template
...
PR-URL: https://github.com/nodejs/node/pull/16923
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
2017-11-17 11:06:01 +01:00
Weijia Wang
e22b8d0c46
lib: improve the usage of TypeError[INVALID_ARG_TYPE]
...
The initials of expected in TypeError[ERR_INVALID_ARG_TYPE]
are inconsistent. This change is to unify them.
PR-URL: https://github.com/nodejs/node/pull/16401
Fixes: https://github.com/nodejs/node/issues/16383
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2017-11-12 11:04:06 -08:00
Luigi Pinca
f60c692499
http: use 'connect' event only if socket is connecting
...
Fixes a bug that prevented `ClientRequest.prototype.setTimeout()` from
working properly when the socket was reused for multiple requests.
Fixes: https://github.com/nodejs/node/issues/16716
Refs: https://github.com/nodejs/node/pull/8895
PR-URL: https://github.com/nodejs/node/pull/16725
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2017-11-06 22:15:48 +01:00
Luigi Pinca
eb2fbd159f
http: do not blindly destroy UNIX domain sockets
...
`Connection: keep-alive` is now properly supported when making client
connections to UNIX domain sockets so `request.abort()` should not
blindly destroy the underlying socket.
PR-URL: https://github.com/nodejs/node/pull/15650
Refs: https://github.com/nodejs/node/pull/13214#issuecomment-304049523
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
2017-10-23 12:13:03 -04:00
Anna Henningsen
3e25e4d00f
http: support generic Duplex streams
...
Support generic `Duplex` streams through more duck typing
on the server and client sides.
Since HTTP is, as a protocol, independent of its underlying transport
layer, Node.js should not enforce any restrictions on what streams
its HTTP parser may use.
Ref: https://github.com/nodejs/node/issues/16256
PR-URL: https://github.com/nodejs/node/pull/16267
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
2017-10-23 17:11:57 +02:00
Robert Nagy
5d99a9bf65
http: emit close as the last event in the client
...
Emit close event after all other events in the client, e.g.
error will be emitted before close.
PR-URL: https://github.com/nodejs/node/pull/15588
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2017-10-18 15:56:19 +02:00
Weijia Wang
212de3c5ec
lib: use destructuring for some constants
...
This change is to unify the declaration for constants into using
destructuring on the top-level-module scope, reducing some redundant
code.
PR-URL: https://github.com/nodejs/node/pull/16063
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
2017-10-16 23:34:32 +02:00
Bryan English
2043944a4c
http: client keep-alive for UNIX domain sockets
...
Makes `Connection: keep-alive` behave correctly when making client
connections to UNIX domain sockets.
Prior to this, connections would never be re-used, but the keep-alive
would cause the connections to stick around until they time out. This
would lead to an eventual EMFILE error due to all the connections
staying open. This was due to http.Agent not properly supporting UNIX
domain sockets.
PR-URL: https://github.com/nodejs/node/pull/13214
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-09-27 18:31:17 -07:00
Luigi Pinca
10be20a0e8
http: set socket timeout when socket connects
...
`request.setTimeout()` calls `socket.setTimeout()` as soon as a socket
is assigned to the request. This makes the `timeout` event to be
emitted on the request even if the underlying socket never connects.
This commit makes `socket.setTimeout()` to be called only when the
underlying socket is connected.
PR-URL: https://github.com/nodejs/node/pull/8895
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2017-09-20 10:41:13 -03:00
fengmk2
620ba41694
http: don't double-fire the req error event
...
req.socket._hadError should be set before emitting the error event.
PR-URL: https://github.com/nodejs/node/pull/14659
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2017-08-16 12:27:43 +02:00
Weijia Wang
11a2ca29ba
errors: migrate _http_outgoing
...
PR-URL: https://github.com/nodejs/node/pull/14735
Refs: https://github.com/nodejs/node/issues/11273
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2017-08-14 17:19:19 -04:00
Weijia Wang
bdfbce9241
http_client, errors: migrate to internal/errors
...
PR-URL: https://github.com/nodejs/node/pull/14423
Refs: https://github.com/nodejs/node/issues/11273
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2017-08-01 14:08:12 +02:00
Rich Trott
095c0de94d
benchmark,lib,test: use braces for multiline block
...
For if/else and loops where the bodies span more than one line, use
curly braces.
PR-URL: https://github.com/nodejs/node/pull/13828
Ref: https://github.com/nodejs/node/pull/13623#discussion_r123048602
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-06-23 14:43:20 -07:00
cjihrig
d0571a926a
https: support rejectUnauthorized for unix sockets
...
This commit allows self signed certificates to work with
unix sockets by forwarding the rejectUnauthorized option.
Fixes: https://github.com/nodejs/node/issues/13470
PR-URL: https://github.com/nodejs/node/pull/13505
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
2017-06-08 13:40:20 -04:00
Sam Roberts
3fba3d6409
http: describe parse err in debug output
...
PR-URL: https://github.com/nodejs/node/pull/13206
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
2017-06-01 16:41:29 -07:00
Brian White
3774c99f66
http: fix IPv6 Host header check
...
PR-URL: https://github.com/nodejs/node/pull/13122
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
2017-05-22 23:04:33 -04:00
Brian White
ed365653f6
http,https: avoid instanceof for WHATWG URL
...
PR-URL: https://github.com/nodejs/node/pull/12983
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2017-05-22 18:07:27 -04:00
Trevor Norris
4a7233c178
lib: implement async_hooks API in core
...
Implement async_hooks support in the following:
* fatalException handler
* process.nextTick
* Timers
* net/dgram/http
PR-URL: https://github.com/nodejs/node/pull/12892
Ref: https://github.com/nodejs/node/pull/11883
Ref: https://github.com/nodejs/node/pull/8531
Reviewed-By: Andreas Madsen <amwebdk@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
2017-05-10 22:22:29 +02:00
Brian White
e283319969
http: fix permanent deoptimizations
...
PR-URL: https://github.com/nodejs/node/pull/12456
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-04-30 03:17:29 -04:00
James M Snell
85a4e25775
http: add type checking for hostname
...
Add type checking for options.hostname / options.host
Maintains the use of `undefined` and `null` for default `localhost`,
but other falsy values (like `false`, `0` and `NaN`) are rejected.
PR-URL: https://github.com/nodejs/node/pull/12494
Ref: https://github.com/nodejs/node/issues/12488
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com >
2017-04-24 10:49:12 -07:00
fengmk2
90403dd1d0
http: should support userland Agent
...
PR-URL: https://github.com/nodejs/node/pull/11567
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-03-26 13:13:58 -07:00
James M Snell
74c1e02642
http: replace uses of self
...
PR-URL: https://github.com/nodejs/node/pull/11594
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2017-03-20 16:01:39 -07:00
James M Snell
5425e0dcbe
http: use more efficient module.exports pattern
...
PR-URL: https://github.com/nodejs/node/pull/11594
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2017-03-20 16:01:31 -07:00
James M Snell
98e54b0bd4
meta: restore original copyright header
...
A prior io.js era commit inappropriately removed the
original copyright statements from the source. This
restores those in any files still remaining from that
edit.
Ref: https://github.com/nodejs/TSC/issues/174
Ref: https://github.com/nodejs/node/pull/10599
PR-URL: https://github.com/nodejs/node/pull/10155
Note: This PR was required, reviewed-by and approved
by the Node.js Foundation Legal Committee and the TSC.
There is no `Approved-By:` meta data.
2017-03-10 11:23:48 -08:00
Brian White
940b5303be
http: use Symbol for outgoing headers
...
PR-URL: https://github.com/nodejs/node/pull/10941
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2017-03-09 05:50:22 -05:00
Jackson Tian
aa8eb8747c
http: use direct parameters instead
...
When parameter count is fixed, use literal Array instance is more
simply and avoid arguments leak also.
PR-URL: https://github.com/nodejs/node/pull/10833
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
2017-01-31 12:56:21 -05:00
Luigi Pinca
18d4ee97d8
http: make request.abort() destroy the socket
...
`request.abort()` did not destroy the socket if it was called
before a socket was assigned to the request and the request
did not use an `Agent` or a Unix Domain Socket was used.
Fixes: https://github.com/nodejs/node/issues/10812
PR-URL: https://github.com/nodejs/node/pull/10818
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2017-01-28 18:04:29 +01:00