Comparing version 0.1.5 to 0.1.6
@@ -175,2 +175,3 @@ /* | ||
content = { "echo": true }, | ||
items = {}, | ||
json = ''; | ||
@@ -193,3 +194,10 @@ | ||
if (Object.keys(query).length) { | ||
content = query; | ||
Object.keys(query).forEach(function(item) { | ||
if (item !== '') { | ||
items[item] = query[item]; | ||
} | ||
}); | ||
if (Object.keys(items).length) { | ||
content = query; | ||
} | ||
} | ||
@@ -196,0 +204,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"author": "Dav Glass <davglass@gmail.com>", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"devDependencies": { | ||
@@ -8,0 +8,0 @@ "vows": "*", |
@@ -7,3 +7,5 @@ var vows = require('vows'), | ||
fs = require('fs'), | ||
echoecho = require('../lib/echo'); | ||
echoecho = require('../lib/echo'), | ||
ip = process.env.IP || '127.0.0.1', | ||
port = process.env.PORT || 8181; | ||
@@ -29,5 +31,5 @@ | ||
}); | ||
server.listen(8181); | ||
server.listen(port); | ||
var baseURL = 'http://127.0.0.1:8181/'; | ||
var baseURL = 'http://' + ip + ':' + port + '/'; | ||
@@ -47,6 +49,6 @@ var fetch = function(o, callback) { | ||
var request = http.request({ | ||
url: '127.0.0.1', | ||
port: 8181, | ||
url: ip, | ||
port: port, | ||
path: o.path, | ||
method: method, | ||
method: fn, | ||
headers: headers | ||
@@ -495,2 +497,14 @@ }, function(res) { | ||
}, | ||
"and get default jsonp with empty querystring (?&callback=baz)": { | ||
topic: function() { | ||
fetch({ | ||
method: 'GET', | ||
path: '/foo/bar/baz/echo/jsonp?&callback=baz' | ||
}, this.callback); | ||
}, | ||
"with query body": function(topic) { | ||
assert.equal(topic.code, 200); | ||
assert.equal('baz({"echo":true,"callback":"baz"});', topic.body); | ||
} | ||
}, | ||
"and get default jsonp without callback": { | ||
@@ -497,0 +511,0 @@ topic: function() { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48032
1149
4
42