Comparing version
@@ -18,2 +18,3 @@ "use strict"; | ||
var ensureAbsoluteUrl = require("./lib/ensureAbsoluteUrl"); | ||
var currentAppConfig = require("./lib/currentAppConfig"); | ||
@@ -227,2 +228,6 @@ var passThrough = function (key) { return key; }; | ||
if (currentAppConfig.name) { | ||
headers["x-exp-fetch-appname"] = currentAppConfig.name; | ||
} | ||
if (typeof optionalBody === "function") { | ||
@@ -229,0 +234,0 @@ resultCallback = optionalBody; |
{ | ||
"name": "exp-fetch", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "A small pluggable fetch lib", | ||
"main": "index.js", | ||
"engines" : { "node" : ">=0.11.0" }, | ||
"engines": { | ||
"node": ">=0.11.0" | ||
}, | ||
"scripts": { | ||
@@ -8,0 +10,0 @@ "test": "mocha test" |
@@ -489,2 +489,13 @@ "use strict"; | ||
}); | ||
describe("app name header", function () { | ||
it("should include app name from package.json", function (done) { | ||
var fetch = fetchBuilder({contentType: "json"}).fetch; | ||
fake.get(path).reply(function () { | ||
this.req.headers['x-exp-fetch-appname'].should.eql("exp-fetch"); | ||
done(); | ||
}); | ||
fetch(host + path); | ||
}); | ||
}); | ||
}); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
52160
1.54%27
3.85%1191
1.97%3
50%67
3.08%