New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

exp-fetch

Package Overview
Dependencies
Maintainers
7
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exp-fetch - npm Package Compare versions

Comparing version

to
1.2.1

lib/currentAppConfig.js

5

index.js

@@ -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;

6

package.json
{
"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);
});
});
});