Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

zipkin-instrumentation-fetch

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zipkin-instrumentation-fetch - npm Package Compare versions

Comparing version 0.13.0 to 0.14.0

4

package.json
{
"name": "zipkin-instrumentation-fetch",
"version": "0.13.0",
"version": "0.14.0",
"description": "Interceptor for HTTP clients using the 'fetch' API",

@@ -19,4 +19,4 @@ "main": "lib/index.js",

"node-fetch": "^1.5.3",
"zipkin": "^0.13.0"
"zipkin": "^0.14.0"
}
}

@@ -41,4 +41,6 @@ const {Tracer, ExplicitContext, createNoopTracer} = require('zipkin');

const path = `http://127.0.0.1:${this.port}/user`;
fetch(path, {method: 'post'})
const host = '127.0.0.1';
const urlPath = '/user';
const url = `http://${host}:${this.port}${urlPath}`;
fetch(url, {method: 'post'})
.then(res => res.json())

@@ -61,4 +63,4 @@ .then(data => {

expect(annotations[2].annotation.annotationType).to.equal('BinaryAnnotation');
expect(annotations[2].annotation.key).to.equal('http.url');
expect(annotations[2].annotation.value).to.equal(path);
expect(annotations[2].annotation.key).to.equal('http.path');
expect(annotations[2].annotation.value).to.equal(urlPath);

@@ -117,4 +119,5 @@ expect(annotations[3].annotation.annotationType).to.equal('ClientSend');

const path = 'http://domain.invalid';
fetch(path, {method: 'post'})
const host = 'domain.invalid';
const url = `http://${host}`;
fetch(url, {method: 'post'})
.then(() => expect.fail())

@@ -137,4 +140,4 @@ .catch(() => {

expect(annotations[2].annotation.annotationType).to.equal('BinaryAnnotation');
expect(annotations[2].annotation.key).to.equal('http.url');
expect(annotations[2].annotation.value).to.equal(path);
expect(annotations[2].annotation.key).to.equal('http.path');
expect(annotations[2].annotation.value).to.equal('/');

@@ -141,0 +144,0 @@ expect(annotations[3].annotation.annotationType).to.equal('ClientSend');

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc