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

@bbc/http-transport

Package Overview
Dependencies
Maintainers
8
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bbc/http-transport - npm Package Compare versions

Comparing version 3.5.3 to 3.5.4

13

lib/transport/request.js

@@ -7,2 +7,3 @@ 'use strict';

const Request = require('request');
const dns = require('dns');

@@ -29,5 +30,12 @@ const REQUIRED_PROPERTIES = [

const req = ctx.req;
const opts = Object.assign({
time: true
time: true,
agentOptions: {
lookup: function(domain, options, cb) {
// Prevent Node from reordering A and AAAA records.
// See https://nodejs.org/api/dns.html#dns_dns_lookup_hostname_options_callback
options.verbatim = true;
return dns.lookup(domain, options, cb);
}
}
}, ctx.opts);

@@ -63,3 +71,2 @@

const method = ctx.req.getMethod();
return this._request[toAsyncMethod(method)](url, opts);

@@ -66,0 +73,0 @@ }

{
"name": "@bbc/http-transport",
"version": "3.5.3",
"version": "3.5.4",
"description": "A flexible, modular REST client built for ease-of-use and resilience.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -8,2 +8,3 @@ 'use strict';

const sandbox = sinon.sandbox.create();
const dns = require('dns');

@@ -255,3 +256,21 @@ const RequestTransport = require('../../lib/transport/request');

});
it('enables uses verbatim', () => {
nock.cleanAll();
api.get('/').reply(200, simpleResponseBody);
sinon.spy(dns, 'lookup');
const ctx = createContext(url);
return new RequestTransport()
.execute(ctx)
.then((ctx) => {
ctx.res.httpResponse.request.agentOptions.lookup('www.example.com', {}, () => {});
sinon.assert.calledWith(dns.lookup, 'www.example.com', {verbatim: true});
})
.catch(assert.ifError);
});
});
});
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