Fix sqlapi request header to be "Host", not "Hostname"

Closes (better) #117 -- automated test included
This commit is contained in:
Sandro Santilli
2014-01-30 16:46:26 +01:00
parent ca4f3d2025
commit 978ea9cd04
3 changed files with 40 additions and 1 deletions
+8
View File
@@ -6,10 +6,14 @@ var o = function(port, cb) {
this.queries = [];
var that = this;
this.requests = [];
this.sqlapi_server = http.createServer(function(req,res) {
//console.log("server got request with method " + req.method);
var query;
that.requests.push(req);
if ( req.method == 'GET' ) {
query = url.parse(req.url, true).query;
that.handleQuery(query, res);
@@ -68,5 +72,9 @@ o.prototype.close = function(cb) {
this.sqlapi_server.close(cb);
};
o.prototype.getLastRequest = function() {
return this.requests.pop();
};
module.exports = o;