Some HTTP clients include a charset parameter in the Content-Type, e.g:
multipart/form-data; charset=utf-8; boundary=0xKhTmLbOuNdArY
This patch makes the multipart parser more forgiving towards unexpected
information included in the Content-Type header.
Simply place this into the root of your nodejs git working copy and
run ./tools/osx-dist.sh. It will create an dist-osx folder which will
comprise of the resulting .dmg file (install path is
/usr/local/nodejs with symlinks added to /usr/local/bin) along with
other files used during its construction.
$ ls -1 dist-osx/
nodejs-v0.1.26-11-gcd6397c
nodejs-v0.1.26-11-gcd6397c.dmg
nodejs-v0.1.26-11-gcd6397c.pkg
nodejs-v0.1.26-11-gcd6397c.plist
The resulting installed package is going to be visible using the
OS X 'pkgutil --packages' command. You can even safely uninstall
sudoing 'pkgutil --unlink org.nodejs.NodeJS-...' and subsequently
let the system forget about the package being ever seen by
'pkgutil --forget org.nodejs.NodeJS-...'.
Here is the current package ID I have installed:
$ pkgutil --pkgs | grep node
org.nodejs.NodeJS-v0.1.26-11-gcd6397c
Use this patch freely without hesitation.
Signed-off-by: Standa Opichal <opichals@gmail.com>
However it's not working very well: Hitting a 'hello world' server with many
requests (ab -t 60 -c 10) will cause it to crash with the following error.
Obtained 3 stack frames.
./node(_Z11print_tracev+0x1c) [0x80d1b3c]
./node(_ZN4node6Parser7ExecuteERKN2v89ArgumentsE+0x69) [0x80d3759]
./node [0x811f44b]
TypeError: Already parsing a buffer
at Socket.<anonymous> (/home/ryan/projects/node/lib/http2.js:393:20)
at IOWatcher.callback (/home/ryan/projects/node/lib/net.js:81:12)
at node.js:985:9
at node.js:989:1
It seems that the current __filename module global is mainly used to
determine the directory the current module is in. To make that
easier, this patch adds support for a __dirname module global
directly.
A promise will throw an exception unless an error handler is attached in the
same "tick" that the error is emitted. This is to avoid silent promise
failures.