0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

12468 Commits

Author SHA1 Message Date
Ben Noordhuis
9a1bc4ea7e util: optimize promise introspection
Use V8's builtin ObjectIsPromise() to check that the value is a promise
before creating the promise mirror.  Reduces garbage collector strain
in the (common) non-promise case, which is beneficial when inspecting
deep object graphs.

PR-URL: https://github.com/nodejs/node/pull/3130
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-09-30 23:43:16 +02:00
Michael Dawson
3f62c401ff i18n: add caller to removal list for bidi in ICU55
For ICU 55 we are currently stripping out bidi and
the callers.  AIX is more pedantic and identified
an additional caller than needed to be stripped out.
This PR adds that caller to those stripped out.

PR-URL: https://github.com/nodejs/node/pull/3115
Reviewed-By: Steven Loomis <srloomis@us.ibm.com>
2015-09-30 10:13:47 -04:00
Rod Vagg
dd8b26758c doc: add TSC meeting minutes 2015-09-16
PR-URL: https://github.com/nodejs/node/pull/3023
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-09-30 22:25:39 +10:00
Rich Trott
0e4b772d6c doc: copyedit fs.watch() information
Removed "Only FSEvents supports this type of file watching so it is
unlikely any additional platforms will be added soon."

Per @saghul, "FSEvents" refers to the OSX API, but since we added
Windows support it may not be  unlikely that we add more.

PR-URL: https://github.com/nodejs/node/pull/3097
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-09-29 23:32:23 -07:00
Minwoo Jung
f1d27d27f5 benchmark: update comment in common.js
Very minor update in benchmark/common.js
Not exactly a critical change, just continued cleaning
out of old joyent/node PRs that never landed.

Ref: https://github.com/nodejs/node-v0.x-archive/pull/8515
PR-URL: https://github.com/nodejs/node/pull/2399
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2015-09-29 16:00:04 -07:00
Evan Lucas
30b8bb0aab src: add process.versions.icu
If i18n support is present, add the icu version
to process.versions

Fixes: https://github.com/nodejs/node/issues/3089
PR-URL: https://github.com/nodejs/node/pull/3102
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-09-29 08:18:03 -05:00
Brendan Ashworth
20dae2a906 smalloc: remove module
Bye bye, smalloc. I'm not sure why this was still here; it was removed
in 70d1f32 and hasn't worked since. It wasn't packaged in the
binary, either.

Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/nodejs/node/pull/3099
2015-09-28 16:22:48 -07:00
Rich Trott
306936e98f test: change calls to deprecated util.print()
common.print() is just util.print() and as such prints a deprecation
warning. Per docs, update to console.log().

PR-URL: https://github.com/nodejs/node/pull/3083
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
2015-09-28 13:21:15 -07:00
Rich Trott
44efd66132 test: replace deprecated util.debug() calls
common.debug() is just util.debug() and emits a deprecation notice. Per
docs, use console.error() instead.

PR-URL: https://github.com/nodejs/node/pull/3082
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2015-09-28 11:15:06 -07:00
Roman Reiss
680dda8023 dns: remove nonexistant exports.ADNAME
This error code export was mistakingly introduced in a 2012 commit which
added more error codes. The correct export.BADNAME was added in
https://github.com/nodejs/node/pull/3051.

Semver: Major
PR-URL: https://github.com/nodejs/node/pull/3051
Fixes: https://github.com/nodejs/node/issues/3050
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-09-27 15:34:08 +02:00
Roman Reiss
24fe112ec5 dns: add missing exports.BADNAME
Adds the documented but missing DNS error exports.BADNAME. This export
has been there before but got lost in a 2012 commit that added more
error codes. https://github.com/nodejs/node/pull/3076 will remove the
wrong error code exports.ADNAME.

PR-URL: https://github.com/nodejs/node/pull/3051
Fixes: https://github.com/nodejs/node/issues/3050
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2015-09-27 13:50:03 +02:00
Ben Noordhuis
212c9c086c src: internalize binding function property names
Internalized strings are created in the old space and that is where they
eventually would end up anyway when created as normal strings.

PR-URL: https://github.com/nodejs/node/pull/3060
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-09-26 20:26:21 +02:00
Ben Noordhuis
590ee58e1c src: internalize per-isolate string properties
Speeds up property lookups a little and it creates the string in the
old space straight away.  It's a little easier on the garbage collector
because it doesn't have to track eternalized strings in the new space.

PR-URL: https://github.com/nodejs/node/pull/3060
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-09-26 20:26:01 +02:00
James M Snell
6192c9892f http: add checkIsHttpToken check for header fields
Ref: https://github.com/nodejs/node-convergence-archive/issues/13

This adds a new check for header and trailer fields names and method
names to ensure that they conform to the HTTP token rule. If they do
not, a `TypeError` is thrown.

Previously this had an additional `strictMode` option that has been
removed in favor of making the strict check the default (and only)
behavior.

Doc and test case are included.

On the client-side
```javascript
var http = require('http');
var url = require('url');
var p = url.parse('http://localhost:8888');
p.headers = {'testing 123': 123};
http.client(p, function(res) { }); // throws
```

On the server-side
```javascript
var http = require('http');
var server = http.createServer(function(req,res) {
  res.setHeader('testing 123', 123); // throws
  res.end('...');
});
```

Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Trevor Norris <trevnorris@nodejs.org>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
PR-URL: https://github.com/nodejs/node/pull/2526
2015-09-25 08:37:57 -07:00
Evan Lucas
b50e89e01f path: improve posixSplitPath performance
Instead of slicing the first element off of the matches, shift and then
return. This improves performance of the following path functions:

- basename: 18-20%
- extname: 60-70%
- dirname: 18-20%
- parse: 20-25%

PR-URL: https://github.com/nodejs/node/pull/3034
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-09-25 08:28:26 -05:00
Cheng Zhao
1b78151ff6 src: include signal.h in util.h
It is required for using the "SIGABRT" constant.

It doesn't cause compilation errors in Node because most files already
have "signal.h" included, but it causes errors for third party embedder.

PR-URL: https://github.com/nodejs/node/pull/3058
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Rod Vagg <r@va.gg>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-09-25 14:25:21 +02:00
Sakthipriyan Vairamani
af881ad647 src: fix function and variable names in comments
The `src/node.js` file is actually loaded and executed by
`node::LoadEnvironment` function.

The variable which has the contents is, `native_node`.

PR-URL: https://github.com/nodejs/node/pull/3039
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-09-25 16:27:17 +05:30
Johann
6df47d6151 crypto: add more keylen sanity checks in pbkdf2
issue #2987 makes the point that crypto.pbkdf2 should not fail silently
and accept invalid but numeric values like NaN and Infinity. We already
check if the keylen is lower than 0, so extending that to NaN and
Infinity should make sense.

Fixes: https://github.com/nodejs/node/issues/2987

PR-URL: https://github.com/nodejs/node/pull/3029
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-09-25 16:17:46 +05:30
Fedor Indutny
36b969ff44 child_process: null channel handle on close
`HandleWrap::OnClose` destroys the underlying C++ object and null's the
internal field pointer to it. Therefore there should be no references to
the wrapping JavaScript object.

`null` the process' `_channel` field right after closing it, to ensure
no crashes will happen.

Fix: https://github.com/nodejs/node/issues/2847
PR-URL: https://github.com/nodejs/node/pull/3041
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-09-25 00:17:45 -04:00
Ben Noordhuis
6ac79bcf58 deps: remove and gitignore .bin directory
The .bin/ directory in deps/npm/node_modules seens to have been an
accidental check-in in commit e79ccee ("npm: upgrade to v2.1.18").
It causes trouble for distro packagers so delete it and blacklist it.

Fixes: https://github.com/nodejs/node/issues/2839
PR-URL: https://github.com/nodejs/node/pull/3004
Reviewed-By: Kat Marchán <kzm@sykosomatic.org>
Reviewed-By: Rod Vagg <r@va.gg>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-09-24 20:04:32 +02:00
Julien Gilli
c22bcd31f0 deps: backport c281c15 from V8's upstream
Backport c281c15d6dab8370a7805f0717502d260e0ad433 from V8's upstream to
allow post-mortem debugging tools to inspect Buffer instances' length.

Original commit message:

  Add JSTypedArray's length in post-mortem metadata.

  BUG=
  R=bmeurer@chromium.org

  Review URL: https://codereview.chromium.org/1363683002

  Cr-Commit-Position: refs/heads/master@{#30873}

PR: #3031
PR-URL: https://github.com/nodejs/node/pull/3031
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-09-23 19:51:12 -07:00
Michał Gołębiowski
02448c69de doc: jenkins-iojs.nodesource.com -> ci.nodejs.org
The Jenkins URL has changed from https://jenkins-iojs.nodesource.com
to https://ci.nodejs.org. The former address now redirects to the
latter. Some jobs has also changed names.

PR-URL: https://github.com/nodejs/node/pull/2886
Reviewed-By: Rod Vagg <r@va.gg>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-09-24 00:20:53 +02:00
Fabio Oliveira
79ebeabd08 docs: Clarify assert.doesNotThrow behavior
The documentation for assert.doesNotThrow now reflects all the inputs
the function accepts, as well as the errors thrown for each combination
of parameter types.

PR-URL: https://github.com/nodejs/node/pull/2807
Reviewed-By: Rich Trott <rtrott@gmail.com>
2015-09-23 15:07:59 -07:00
P.S.V.R
76c80d4c61 build: iojs -> nodejs of release-urlbase
PR-URL: https://github.com/nodejs/node/pull/3015
Reviewed-By: Rod Vagg <r@va.gg>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-09-23 22:25:16 +02:00
Laurent Fortin
2d21092400 doc: rearrange execSync and execFileSync
Changed the ordering so it is in line with the async methods.

PR-URL: https://github.com/nodejs/node/pull/2940
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-09-23 22:20:18 +02:00
Laurent Fortin
28da400d47 doc: make execFileSync in line with execFile
PR-URL: https://github.com/nodejs/node/pull/2940
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-09-23 22:19:12 +02:00
P.S.V.R
d0d48774ed build: fix some typos inside the configure script
PR-URL: https://github.com/nodejs/node/pull/3016
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-09-23 22:09:59 +02:00
reggi
ffdbe9d4f1 doc: fix typos in cluster & errors
PR-URL: https://github.com/nodejs/node/pull/3011
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-09-23 22:06:43 +02:00
P.S.V.R
5ac5419c0b doc: switch LICENSE from closure-linter to eslint
Ref: https://github.com/nodejs/node/pull/1539
PR-URL: https://github.com/nodejs/node/pull/3018
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com>
2015-09-23 12:50:11 +02:00
Rod Vagg
4a6f1feecb 2015-09-22, Version 4.1.1 (Stable) Release
Notable changes

* buffer: Fixed a bug introduced in v4.1.0 where allocating a new
  zero-length buffer can result in the next allocation of a TypedArray
  in JavaScript not being zero-filled. In certain circumstances this
  could result in data leakage via reuse of memory space in
  TypedArrays, breaking the normally safe assumption that TypedArrays
  should be always zero-filled. (Trevor Norris) #2931.
* http: Guard against response-splitting of HTTP trailing headers
  added via response.addTrailers() by removing new-line ([\r\n])
  characters from values. Note that standard header values are already
  stripped of new-line characters. The expected security impact is low
  because trailing headers are rarely used. (Ben Noordhuis) #2945.
* npm: Upgrade to npm 2.14.4 from 2.14.3, see release notes for full
  details (Kat Marchán) #2958
  - Upgrades graceful-fs on multiple dependencies to no longer rely on
    monkey-patching fs
  - Fix npm link for pre-release / RC builds of Node
* v8: Update post-mortem metadata to allow post-mortem debugging tools
  to find and inspect:
  - JavaScript objects that use dictionary properties
    (Julien Gilli) #2959
  - ScopeInfo and thus closures (Julien Gilli) #2974

PR-URL: https://github.com/nodejs/node/pull/2995
2015-09-23 11:33:13 +10:00
Sakthipriyan Vairamani
f32a606e37 lib,src: remove usage of events.EventEmitter
The `events` module already exports `EventEmitter` constructor function
So, we don't have to use `events.EventEmitter` to access it.

Refer: https://github.com/nodejs/node/pull/2896

PR-URL: https://github.com/nodejs/node/pull/2921
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2015-09-23 00:23:08 +05:30
Sakthipriyan Vairamani
7953c83b85 doc: remove usage of events.EventEmitter
The `events` module already exports `EventEmitter` constructor function
So, we don't have to use `events.EventEmitter` to access it.

Refer: https://github.com/nodejs/node/pull/2896

PR-URL: https://github.com/nodejs/node/pull/2921
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2015-09-23 00:22:11 +05:30
Salman Aljammaz
ccea33df62 repl: don't use tty control codes when $TERM is set to "dumb"
This change stops the REPL from using ANSI control codes for colours
when the TERM environment variable is set to "dumb".

"dumb" is the terminal type with the smallest set of capabilities as
described by terminfo. See:

http://invisible-island.net/ncurses/terminfo.ti.html#toc-_Specials

Related: https://github.com/nodejs/node-v0.x-archive/issues/5344
Related: https://github.com/nodejs/node-v0.x-archive/pull/25506
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
PR-URL: https://github.com/nodejs/node/pull/2712
2015-09-22 19:38:46 +02:00
Malcolm Ahoy
79d2c4e1bf http: remove redundant code in _deferToConnect
Logic for calling the passed in socket method and/or callback
was duplicated. This commit refactors the relevant code to
remove the redundancy.

PR-URL: https://github.com/nodejs/node/pull/2769
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
2015-09-22 11:04:26 -04:00
Sakthipriyan Vairamani
fcfd87d7e1 repl: backslash bug fix
The actual problem was with the line parsing logic for string literals.
When we use backslash in the string literals, it used to remember the
`\` as the previous character even after we parsed the character next
to it. This leads to REPL thinking that the end of string literals is
not reached.

This patch replaces the previous character with `null`, so that it will
properly skip the character next to it.

Previous Discussion: https://github.com/nodejs/node/pull/2952
Fixes: https://github.com/nodejs/node/issues/2749
PR-URL: https://github.com/nodejs/node/pull/2968
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-09-22 16:43:14 +02:00
Julien Gilli
75fe7739e6 deps: backport 357e6b9 from V8's upstream
Backport 357e6b99ee3927cc075dd8d27c99b89d858f9dd5 from V8's upstream.

Original commit message:

  Add ScopeInfo constants to post-mortem metadata

  mdb_v8, a post-mortem debugging tool for Node.js, allows users to
  inspect ScopeInfo structures in order to get more information about
  closures.

  Currently, it hardcodes the metadata it uses to find this information.
  This change allows it to get this metadata from the node binary itself,
  and thus to adapt to future changes made to the layout of the ScopeInfo
  data structure.

  BUG=

  R=bmeurer@chromium.org

PR: #2974
PR-URL: https://github.com/nodejs/node/pull/2974
Reviewed-By: Rod Vagg <r@va.gg>
Reviewed-By: Ben Noordhuis <ben@strongloop.com>
2015-09-21 09:36:41 -07:00
Christopher J. Brody
451acc7559 doc: remove extra using v8::HandleScope statement
v8::HandleScope does not seem to be required for addon functions.

PR-URL: https://github.com/nodejs/node/pull/2983
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-09-21 17:58:11 +02:00
Jérémy Lal
5819d7a050 configure: detect mipsel host
Detect mipsel before mips because mipsel has __mips__ flag as well.

PR-URL: https://github.com/nodejs/node/pull/2971
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-09-21 12:03:19 +02:00
Sakthipriyan Vairamani
571a517259 test: test sync version of mkdir & rmdir
This patch includes tests for sync versions of mkdir and rmdir.
Also, it moves the test to `parallel`.

PR-URL: https://github.com/nodejs/node/pull/2588
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-09-21 12:42:45 +05:30
Julien Gilli
4e028bd34d deps: backport ff7d70b from V8's upstream
Original commit message:

  Update BitField3 type in gen-postmortem-metadata.py

  Since https://codereview.chromium.org/272163002, BitField3 is a raw
  uint32 field, and not a SMI anymore.

  Update tools/gen-postmortem-metadata.py so that post-mortem tools can
  work with versions of V8 that shipped after that change.

  This change was merged in github.com/joyent/node right before node
  v0.12.0 was released.

  R=danno@chromium.org

  TEST=mdb_v8, a post-mortem debugging tool running on SmartOS,  has been
  using this change since Node.js v0.12.0 was released

  BUG=

  Review URL: https://codereview.chromium.org/1296743003

  Cr-Commit-Position: refs/heads/master@{#30839}

PR: #2959
PR-URL: https://github.com/nodejs/node/pull/2959
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Rod Vagg <r@va.gg>
2015-09-20 15:42:08 -07:00
Kat Marchán
2c09a5364e deps: upgraded to node-gyp@3.0.3 in npm
PR-URL: https://github.com/nodejs/node/pull/2958
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-09-20 10:16:30 -07:00
Kat Marchán
57c44324c1 deps: upgrade to npm 2.14.4
PR-URL: https://github.com/nodejs/node/pull/2958
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-09-20 10:15:03 -07:00
Sakthipriyan Vairamani
61d48b45b5 test: use tmpDir instead of fixtures in readdir
This patch

 - makes the test use tmp directory instead of the fixtures directory,
 - simplifies the code
 - moves the test to `parallel`.

PR-URL: https://github.com/nodejs/node/pull/2587

Reviewed-By: Rich Trott <rtrott@gmail.com>
2015-09-20 16:18:07 +05:30
Fedor Indutny
229a03f1bb http_parser: do not dealloc during kOnExecute
`freeParser` deallocates `Parser` instances early if they do not fit
into the free list. This does not play well with recent socket
consumption change, because it will try to deallocate the parser while
executing on its stack.

Regression was introduced in: 1bc4468

Fix: https://github.com/nodejs/node/issues/2928
PR-URL: https://github.com/nodejs/node/pull/2956
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2015-09-19 03:30:11 -04:00
Rich Trott
4fb4c14b61 doc: clarify description of assert.ifError()
This fixes a few typographical errors (comma splices and the like) and
clarifies the description of assert.ifError(). It also standardizes the
document on "inequality" rather than having both "inequality" and "non-
equality".

PR-URL: https://github.com/nodejs/node/pull/2941
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-09-18 23:46:36 -07:00
Ben Noordhuis
e68a119c18 http: guard against response splitting in trailers
Commit 3c293ba ("http: protect against response splitting attacks")
filters out newline characters from HTTP headers but forgot to apply
the same logic to trailing HTTP headers, i.e., headers that come after
the response body.  This commit rectifies that.

The expected security impact is low because approximately no one uses
trailing headers.  Some HTTP clients can't even parse them.

PR-URL: https://github.com/nodejs/node/pull/2945
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Rod Vagg <r@va.gg>
2015-09-18 21:36:27 +02:00
Ben Noordhuis
a9ad31fb3d test: test more http response splitting scenarios
The test verified the output of http.OutgoingMessage#writeHead() but
not http.OutgoingMessage#setHeader().  Also check the response body.

PR-URL: https://github.com/nodejs/node/pull/2945
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Rod Vagg <r@va.gg>
2015-09-18 21:36:27 +02:00
Alexis Campailla
4144cb054c test: add test-spawn-cmd-named-pipe
Adding a Windows test to verify that a node process spawned via
cmd with named pipes can access its stdio streams.

Ref: https://github.com/nodejs/node-v0.x-archive/issues/7345

PR-URL: https://github.com/nodejs/node/pull/2770
Reviewed-By: cjihrig - Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: thefourtheye - Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: evanlucas - Evan Lucas <evanlucas@me.com>
2015-09-18 11:51:51 -04:00
Matt Harrison
e29e470c14 readline: fix tab completion bug
This fixes a problem where tab completion is empty when the input
stream column size is undefined. As a solution we can force maxColumns
to 1 in this scenario.

PR-URL: https://github.com/nodejs/node/pull/2816
Fixes: https://github.com/nodejs/node/issues/2396
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-09-18 14:32:00 +02:00
Trevor Norris
0a329d2d1f buffer: don't set zero fill for zero-length buffer
Instantiating a Buffer of length zero would set the kNoZeroFill flag to
true but never actually call ArrayBuffer::Allocator(). Which means the
flag was never set back to false. The result was that the next
allocation would unconditionally not be zero filled.

Add test to ensure Uint8Array's are zero-filled after creating a Buffer
of length zero. This test may falsely succeed, but will not falsely fail.

Fix: https://github.com/nodejs/node/issues/2930
PR-URL: https://github.com/nodejs/node/pull/2931
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-09-18 01:14:16 -06:00