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

axiosist

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axiosist - npm Package Compare versions

Comparing version 0.6.2 to 0.7.0

22

index.js

@@ -10,4 +10,4 @@ /**

const http = require('http')
const url = require('url')
const { Server, createServer } = require('http')
const { URL } = require('url')

@@ -30,17 +30,15 @@ const axios = require('axios').default

const createAdapter = handler => config => new Promise((resolve, reject) => {
const urlObject = url.parse(config.url || '')
const url = new URL(config.url || '', 'http://axiosist/')
// Forcely set protocol to HTTP
urlObject.protocol = 'http:'
urlObject.slashes = true
url.protocol = 'http'
const host = urlObject.host
delete urlObject.host
urlObject.hostname = '127.0.0.1'
const host = url.host
url.host = '127.0.0.1'
// Apply original host to request header
if (host != null && config.headers.host == null) {
if (host !== 'axiosist' && config.headers.host == null) {
config.headers.host = host
}
const server = handler instanceof http.Server ? handler : http.createServer(handler)
const server = handler instanceof Server ? handler : createServer(handler)
const listening = server.listening

@@ -56,4 +54,4 @@

const address = /** @type {AddressInfo} */(server.address())
urlObject.port = address.port.toString()
config.url = url.format(urlObject)
url.port = address.port.toString()
config.url = url.toString()
return defaultAdapter(config)

@@ -60,0 +58,0 @@ })

{
"name": "axiosist",
"version": "0.6.2",
"version": "0.7.0",
"description": "Convert node.js request handler to axios adapter",

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

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