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

axios-cached-dns-resolve

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axios-cached-dns-resolve - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

32

axios-cached-dns-resolve.js

@@ -100,20 +100,24 @@ /* eslint-disable no-plusplus */

axios.interceptors.request.use(async (reqConfig) => {
let url
if (reqConfig.baseURL) {
url = URL.parse(reqConfig.baseURL)
} else {
url = URL.parse(reqConfig.url)
}
try {
let url
if (reqConfig.baseURL) {
url = URL.parse(reqConfig.baseURL)
} else {
url = URL.parse(reqConfig.url)
}
if (net.isIP(url.hostname)) return reqConfig // skip
if (net.isIP(url.hostname)) return reqConfig // skip
reqConfig.headers.Host = url.hostname // set hostname in header
reqConfig.headers.Host = url.hostname // set hostname in header
url.hostname = await getAddress(url.hostname)
delete url.host // clear hostname
url.hostname = await getAddress(url.hostname)
delete url.host // clear hostname
if (reqConfig.baseURL) {
reqConfig.baseURL = URL.format(url)
} else {
reqConfig.url = URL.format(url)
if (reqConfig.baseURL) {
reqConfig.baseURL = URL.format(url)
} else {
reqConfig.url = URL.format(url)
}
} catch (err) {
recordError(err, `Error getAddress, ${err.message}`)
}

@@ -120,0 +124,0 @@

{
"name": "axios-cached-dns-resolve",
"version": "1.1.0",
"version": "1.2.0",
"main": "index.js",

@@ -38,4 +38,4 @@ "description": "Caches dns resolutions made with async dns.resolve instead of default sync dns.lookup, refreshes in background",

"delay": "^4.4.0",
"eslint": "^7.12.1",
"eslint-config-airbnb-base": "^14.2.0",
"eslint": "^7.14.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-import": "^2.22.1",

@@ -42,0 +42,0 @@ "eslint-watch": "^7.0.0",

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