James M Snell
8e579ba759
http: strictly forbid invalid characters from headers
...
PR-URL: https://github.com/nodejs/node-private/pull/26
2016-02-09 08:43:02 -08:00
James M Snell
98fde2f6a7
deps: update http-parser to version 2.6.1
...
includes parsing improvements to ensure closer HTTP spec conformance
PR-URL: https://github.com/nodejs/node-private/pull/26
2016-02-09 08:43:02 -08:00
Shigeki Ohtsu
9dcc45e9c5
test: enable to work pkcs12 test in FIPS mode
...
The pfx file created by pkcs12 command of openssl causes an error in
FIPS mode because its certificate is encrypted with RC2 by default.
Adding `-descert` option resolves the error.
Fix: https://github.com/nodejs/node/pull/5144
Fix: https://github.com/nodejs/node/pull/5109
PR-URL: https://github.com/nodejs/node/pull/5150
Reviewed-By: Rich Trott <rtrott@gmail.com >
2016-02-09 23:07:56 +11:00
Fedor Indutny
e4390664ae
test: disable gh-5100 test when in FIPS mode
...
This is a follow-up fix for half-broken test in 23196fe , and an attempt
to recover some dignity after breaking CI.
PR-URL: https://github.com/nodejs/node/pull/5144
Reviewed-By: Rich Trott <rtrott@gmail.com >
2016-02-09 23:07:56 +11:00
Fedor Indutny
d9e934c71f
crypto: add pfx certs as CA certs too
...
According to documentation all certificates specified in `pfx` option
should be treated as a CA certificates too. While it doesn't seem to be
logically correct to me, we can't afford to break API stability at this
point.
Fix : #5100
PR-URL: https://github.com/nodejs/node/pull/5109
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp >
2016-02-09 23:07:53 +11:00
Rich Trott
cf3aa911ec
test: fix flaky test-dgram-pingpong
...
There is no guarantee UDP messages will be received. Accommodate the
occasional dropped message.
This is a functionality test, not a performance benchmark. Speed up the
test by not sending 1500 messages across three ports.
Fixes: https://github.com/nodejs/node/issues/4526
PR-URL: https://github.com/nodejs/node/pull/5125
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-02-09 23:07:52 +11:00
Rich Trott
63884f57dd
test: mark flaky tests on Raspberry Pi
...
A few tests have started failing on Raspberry Pi devices in CI.
https://ci.nodejs.org/job/node-test-binary-arm/943/
PR-URL: https://github.com/nodejs/node/pull/5082
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Roman Klauke <romaaan.git@gmail.com >
Ref: https://github.com/nodejs/node/issues/4830
Ref: https://github.com/nodejs/node/issues/3635
Ref: https://github.com/nodejs/node/issues/4526
2016-02-09 23:07:51 +11:00
Myles Borins
7003a4e3d8
node_contextify: do not incept debug context
...
Currently a debug context is created for various calls to util.
If the node debugger is being run the main context is the debug
context. In this case node_contextify was freeing the debug context
and causing everything to explode.
This change moves around the logic and no longer frees the context.
There is a concern about the dangling pointer
The regression test was adapted from code submitted by @3y3 in #4815
Fixes: https://github.com/nodejs/node/issues/4440
Fixes: https://github.com/nodejs/node/issues/4815
Fixes: https://github.com/nodejs/node/issues/4597
Fixes: https://github.com/nodejs/node/issues/4952
PR-URL: https://github.com/nodejs/node/issues/4815
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2016-02-09 23:07:50 +11:00
Myles Borins
85743c0e92
querystring: check that maxKeys is finite
...
There was a very subtle change in behavior introduced with 27def4f
In the past if querystring.parse was given Infinity for maxKeys,
everything worked as expected.
Check to see is maxKeys is Infinity before forwarding the value to
String.prototype.split which causes this regression
PR-URL: https://github.com/nodejs/node/pull/5066
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Rod Vagg <rod@vagg.org >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
2016-02-09 23:07:50 +11:00
HUANG Wei
3175f7450e
buffer: remove duplicated code in fromObject
...
Add fromArrayLike() to handle logic of copying in values from array-like
argument.
PR-URL: https://github.com/nodejs/node/pull/4948
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Trevor Norris <trev.norris@gmail.com >
2016-02-09 23:07:50 +11:00
Rich Trott
53cbd0564f
tools: lint for spacing around unary operators
...
Enable `space-unary-ops` in `.eslintrc`. This prohibits things like:
i ++ // use `i++` instead
typeof(foo) // use `typeof foo` or `typeof (foo)` instead
Ref: https://github.com/nodejs/node/pull/4772#discussion_r51732299
PR-URL: https://github.com/nodejs/node/pull/5063
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-02-09 23:07:49 +11:00
Santiago Gimeno
09917c99d8
test: fix net-socket-timeout-unref flakiness
...
From time to time this test is failing in OS X because at least one of
the connections takes quite a long time (around 5 seconds) causing some
of the timers may fire before the test exited. To solve this, wait for
all the connections to be established before setting the timeouts and
unrefing the sockets.
PR-URL: https://github.com/nodejs/node/pull/4772
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-02-08 23:15:06 +11:00
Rich Trott
83da19aa48
test: fix redeclared test-event-emitter-* vars
...
PR-URL: https://github.com/nodejs/node/pull/4985
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Johan Bergström <bugs@bergstroem.nu >
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
2016-02-08 23:01:22 +11:00
Rich Trott
87b27c913d
test: fix redeclared test-intl var
...
PR-URL: https://github.com/nodejs/node/pull/4988
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Johan Bergström <bugs@bergstroem.nu >
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
2016-02-08 23:01:22 +11:00
Rich Trott
e98772d68e
test: remove redeclared var in test-domain
...
PR-URL: https://github.com/nodejs/node/pull/4984
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Johan Bergström <bugs@bergstroem.nu >
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
2016-02-08 23:01:22 +11:00
Rich Trott
443d0463ca
test: add common.platformTimeout() to dgram test
...
Use common.platformTimeout() to mitigate potential for CI to timeout
on slower devices.
Ref: https://github.com/nodejs/node/issues/4937
PR-URL: https://github.com/nodejs/node/pull/4938
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Myles Borins <mborins@us.ibm.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2016-02-08 23:01:21 +11:00
Rich Trott
90219c3398
test: fix flaky cluster test on Windows 10
...
test-cluster-shared-leak was flaky on Windows 10. Remove unnecessary
.send() calls and replace with .disconnect() to avoid spurious EPIPE.
Fixes: https://github.com/nodejs/node/issues/4887
PR-URL: https://github.com/nodejs/node/pull/4934
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-02-08 23:01:21 +11:00
Rich Trott
3488fa81b5
test: fix variable redeclarations
...
I'm a fan of small changesets, but even I'm getting a little annoyed at
me for opening all these PRs weeding out variable redeclarations. So I'm
bundling a bunch of small changes here.
PR-URL: https://github.com/nodejs/node/pull/4992
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-02-08 23:01:20 +11:00
Rich Trott
7dc0905d4d
test: fix redeclared test-util-* vars
...
PR-URL: https://github.com/nodejs/node/pull/4994
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Roman Klauke <romaaan.git@gmail.com >
2016-02-08 23:01:20 +11:00
Rich Trott
53e7d605c9
test: fix redeclared vars in sequential tests
...
PR-URL: https://github.com/nodejs/node/pull/4999
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Roman Klauke <romaaan.git@gmail.com >
2016-02-08 23:01:20 +11:00
Santiago Gimeno
a62ace9f7e
test: fix tls-no-rsa-key flakiness
...
In some conditions it can happen that the client-side socket is destroyed
before the server-side socket has gracefully closed, thus causing a
'ECONNRESET' error in this socket. To solve this, wait in the client-side
socket for the 'end' event before closing it.
PR-URL: https://github.com/nodejs/node/pull/4043
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2016-02-08 23:01:19 +11:00
Rich Trott
9b8f025816
test: fix redeclared vars in test-url
...
PR-URL: https://github.com/nodejs/node/pull/4993
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2016-02-08 23:01:18 +11:00
Rich Trott
51fb8845d5
test: fix redeclared test-path vars
...
PR-URL: https://github.com/nodejs/node/pull/4991
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
Reviewed-By: Roman Klauke <romaaan.git@gmail.com >
Reviewed-By: Johan Bergström <bugs@bergstroem.nu >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-02-08 23:01:17 +11:00
Rich Trott
b16b360ae8
test: fix var redeclarations in test-os
...
PR-URL: https://github.com/nodejs/node/pull/4990
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
Reviewed-By: Roman Klauke <romaaan.git@gmail.com >
Reviewed-By: Johan Bergström <bugs@bergstroem.nu >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-02-08 23:01:17 +11:00
Fedor Indutny
101de9de3f
https: evict cached sessions on error
...
Instead of using the same session over and over, evict it when the
socket emits error. This could be used as a mitigation of #3692 , until
OpenSSL fix will be merged/released.
See: https://github.com/nodejs/node/issues/3692
PR-URL: https://github.com/nodejs/node/pull/4982
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp >
2016-02-08 23:01:16 +11:00
Rich Trott
d6199773e8
test: fix test-net-* variable redeclarations
...
PR-URL: https://github.com/nodejs/node/pull/4989
Reviewed-By: Johan Bergström <bugs@bergstroem.nu >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Roman Klauke <romaaan.git@gmail.com >
2016-02-08 23:01:16 +11:00
Rich Trott
9dd5b3e01b
test: fix redeclared test-http-* vars
...
PR-URL: https://github.com/nodejs/node/pull/4987
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Roman Klauke <romaaan.git@gmail.com >
2016-02-08 23:01:15 +11:00
Rich Trott
835bf13c1d
test: fix var redeclarations in test-fs-*
...
PR-URL: https://github.com/nodejs/node/pull/4986
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Roman Klauke <romaaan.git@gmail.com >
2016-02-08 23:01:15 +11:00
Rich Trott
71d7a4457d
test: fix redeclared vars in test-vm-*
...
PR-URL: https://github.com/nodejs/node/pull/4997
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-02-08 23:01:14 +11:00
Brian White
38459402a5
test: fix inconsistent styling in test-url
...
PR-URL: https://github.com/nodejs/node/pull/5014
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-02-08 23:01:14 +11:00
Rich Trott
4934798c0d
test: pummel test fixes
...
This fixes some variable redeclarations in pummel tests and, in the
process, gets `test-stream-pipe-multi.js` to run again. It had been
failing to run.
PR-URL: https://github.com/nodejs/node/pull/4998
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-02-08 23:01:13 +11:00
Rich Trott
3970504298
test: remove var redeclarations in test-crypto-*
...
PR-URL: https://github.com/nodejs/node/pull/4981
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-02-08 23:01:12 +11:00
Rich Trott
a2881e2187
test: remove test-cluster-* var redeclarations
...
PR-URL: https://github.com/nodejs/node/pull/4980
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-02-08 23:01:12 +11:00
Santiago Gimeno
c3d93299c2
test: fix test-http-extra-response flakiness
...
It can happen that the extra response is to be sent in a different chunk
from the rest of the data. At this moment, the client might have already
closed the socket causing an `ECONNRESET` error.
PR-URL: https://github.com/nodejs/node/pull/4979
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-02-08 23:01:11 +11:00
Alan Cohen
0384a43885
test: Add assertion for TLS peer certificate fingerprint
...
PR-URL: https://github.com/nodejs/node/pull/4923
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-02-08 23:01:10 +11:00
Rich Trott
48a353fe41
test: scope redeclared vars in test-child-process*
...
A handful of child process tests had variables declared multiple times
in the same scope using `var`. This change scopes those declarations.
PR-URL: https://github.com/nodejs/node/pull/4944
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
2016-02-08 23:01:06 +11:00
Michaël Zasso
58d67e26a2
buffer: validate list elements in Buffer.concat
...
Without this change, if any of the elements in the list to be concatenated is
not a Buffer instance, the method fails with "buf.copy is not a function".
Make an isBuffer check before using the copy method so that we can throw with
a better message.
Fixes: https://github.com/nodejs/node/issues/4949
PR-URL: https://github.com/nodejs/node/pull/4951
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Roman Klauke <romaaan.git@gmail.com >
2016-02-08 23:01:05 +11:00
Evan Lucas
c9b05dafe0
net: move isLegalPort to internal/net
...
isLegalPort can be used in more places than just net.js. This change
moves it to a new internal net module in preparation for using it in
the dns module.
PR-URL: https://github.com/nodejs/node/pull/4882
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
2016-02-08 23:01:04 +11:00
Rich Trott
14f5bb7a99
test,buffer: refactor redeclarations
...
Many variables in the buffer tests are redeclared. Change them so that
they are scoped appropriately.
PR-URL: https://github.com/nodejs/node/pull/4893
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-02-08 23:01:01 +11:00
Santiago Gimeno
89d1149467
test: fix test-tls-zero-clear-in flakiness
...
It can happen that the server-side socket is destroyed before the
client-side socket has gracefully closed, thus causing a 'ECONNRESET'
error in this socket. To solve this, also close gracefully in the server
side too.
PR-URL: https://github.com/nodejs/node/pull/4888
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Fedor Indutny <fedor@indutny.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2016-02-08 23:01:00 +11:00
Fedor Indutny
d6fbd81a7a
tls_wrap: reach error reporting for UV_EPROTO
...
Do not swallow error details when reporting UV_EPROTO asynchronously,
and when creating artificial errors.
Fix : #3692
PR-URL: https://github.com/nodejs/node/pull/4885
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2016-02-08 23:00:58 +11:00
Vladimir Kurchatkin
f7ed47341a
test: remove Object.observe from tests
...
Testing this wasn't really useful, besides Object.observe is going to be
deprecated.
Also this test fails with Chakra (#4765 ) for obvious reason.
PR-URL: https://github.com/nodejs/node/pull/4769
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Roman Reiss <me@silverwind.io >
2016-02-08 23:00:57 +11:00
Rich Trott
d95e53dc3b
test: refactor switch
...
`test-child-process-fork-net2.js` has a switch statement with 6 cases.
Each case uses `child.send()`, passing an object for the callback.
`child.send()` ignores the callback because it is not a function.
Removing the unused argument.
PR-URL: https://github.com/nodejs/node/pull/4870
Reviewed-By: Alexis Campailla <orangemocha@nodejs.org >
2016-02-08 23:00:56 +11:00
Rich Trott
7f1e3e929a
test: remove race condition in http flood test
...
Timer race results in some flakiness on slower devices in CI. Remove
unneeded setTimeout() and replace booleans with common.mustCall().
PR-URL: https://github.com/nodejs/node/pull/4793
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-02-08 23:00:56 +11:00
Rich Trott
6539c64e67
test: scope redeclared variable
...
`test-assert.js` redeclares a variable with `var`. This change converts
it to a `const` declaration and wraps it in a standalone block to scope
it to just the test that uses it.
PR-URL: https://github.com/nodejs/node/pull/4854
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com >
2016-02-08 23:00:55 +11:00
Roman Reiss
62fb941557
test: fix irregular whitespace issue
...
PR-URL: https://github.com/nodejs/node/pull/4864
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Roman Klauke <romaaan.git@gmail.com >
2016-02-08 23:00:54 +11:00
Drew Folta
3b225209f0
test: fs.link() test runs on same device
...
When running the tests if `NODE_TEST_DIR` is set to a device different
than the location of the test files (where this repo is checked out),
then the parallel/test-fs-link.js test will fail with
`EXDEV: cross-device link not permitted`. The code works fine (and is in
fact throwing an error as desired) but the test fails.
This commit first creates the "source" file in the same directory as the
"destination" (where the hardlink will be created).
PR-URL: https://github.com/nodejs/node/pull/4861
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2016-02-08 23:00:53 +11:00
Rich Trott
1860eae110
test: refactor test-net-settimeout
...
test-net-settimeout is unnecessarily complex. This change simplifies it.
PR-URL: https://github.com/nodejs/node/pull/4799
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: Johan Bergström <bugs@bergstroem.nu >
2016-02-08 23:00:53 +11:00
Evan Lucas
fa0457ed04
dns: throw a TypeError in lookupService with invalid port
...
Previously, port was assumed to be a number and would cause an abort in
cares_wrap. This change throws a TypeError if port is not a number
before we actually hit C++.
Fixes: https://github.com/nodejs/node/issues/4837
PR-URL: https://github.com/nodejs/node/pull/4839
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Roman Klauke <romaaan.git@gmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
2016-02-08 23:00:49 +11:00
Rich Trott
ae9a8cd053
test: mark test-tick-processor flaky
...
PR-URL: https://github.com/nodejs/node/pull/4809
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Johan Bergström <bugs@bergstroem.nu >
Reviewed-By: James M Snell <jasnell@gmail.com >
Ref: https://github.com/nodejs/node/issues/4427
2016-01-25 21:43:22 +11:00