From 4161321ea72dcf54c545c459d5c4dbbf0b65ac1d Mon Sep 17 00:00:00 2001 From: Pepper Date: Fri, 21 Mar 2014 13:21:34 -0400 Subject: [PATCH] added request.postData, request.contentLength and request.cookie --- cgi.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cgi.js b/cgi.js index 3ec44b8..dd08d49 100644 --- a/cgi.js +++ b/cgi.js @@ -1,4 +1,5 @@ var sys = require('sys'), +fs = require('fs'), http = require('http'); var Request = function() { @@ -8,6 +9,12 @@ var Request = function() { 'user-agent': process.env['HTTP_USER_AGENT'] }; this.url = process.env['REQUEST_URI']; + this.contentLength = process.env['CONTENT_LENGTH']; + this.cookie = process.env['HTTP_COOKIE']; + this.postData = undefined; + if (this.method == 'POST'){ + this.postData = fs.readFileSync('/dev/stdin').toString(); + } }; var Response = function() {