Port this over: https://github.com/driverdan/node-XMLHttpRequest/pull/150 Thanks for the PR @boggan.