Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove stupid workaround and some other fixes.

  • Loading branch information...
commit 12b116fe4375d0ca46228c36ff4044a922994cdc 1 parent 011efd9
@TooTallNate authored
Showing with 4 additions and 11 deletions.
  1. +2 −9 cgi.js
  2. +2 −2 test/env.js
View
11 cgi.js
@@ -23,7 +23,7 @@ function cgi(cgiBin, options) {
var host = (req.headers.host || '').split(':');
var address = host[0];
var port = host[1];
- if (!address || !port && typeof this.address == 'function') {
+ if ((!address || !port) && typeof(this.address) === 'function') {
var serverAddress = this.address();
if (!address) address = serverAddress.address;
if (!port) port = serverAddress.port;
@@ -81,13 +81,6 @@ function cgi(cgiBin, options) {
//'customFds': fds,
'env': env
});
-
-
- // Work-around some weird Node bug where a child process won't emit
- // any events... or something... still figuring it out.
- // This SHOULDN'T be needed.
- require('util').inspect(cgiSpawn, true, 5);
-
// The request body is piped to 'stdin' of the CGI spawn
req.pipe(cgiSpawn.stdin);
@@ -116,7 +109,7 @@ function cgi(cgiBin, options) {
if (header.key === 'Status') return;
res.setHeader(header.key, header.value);
});
- res.writeHead(parseInt(headers.status) || 200);
+ res.writeHead(parseInt(headers.status) || 200, {});
// The response body is piped to the response body of the HTTP request
cgiResult.pipe(res);
View
4 test/env.js
@@ -10,7 +10,7 @@ var server = http.createServer(
)
);
server.listen(PORT, function() {
-/* console.log('server listening');
+ console.log('server listening');
var client = http.createClient(PORT);
var req = client.request('GET', '/?test=1');
@@ -19,5 +19,5 @@ server.listen(PORT, function() {
res.pipe(process.stdout, {end:false});
res.on('end', client.end.bind(client));
});
- req.end();*/
+ req.end();
});
Please sign in to comment.
Something went wrong with that request. Please try again.