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

gohttp

Package Overview
Dependencies
Maintainers
1
Versions
125
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gohttp - npm Package Compare versions

Comparing version 5.0.2 to 5.0.3-beta

60

http2proxy.js

@@ -36,3 +36,23 @@ 'use strict'

function fmtpath (path) {
path = path.trim()
if (path.length == 0) {
return '/*'
}
if (path[0] !== '/') {
path = `/${path}`
}
if (path.length > 1 && path[path.length - 1] !== '/') {
path = `${path}/`
}
if (path.indexOf('/:') >= 0) {
return path.substring(0, path.length-1)
}
return `${path}*`
}
let hiiproxy = function (options = {}) {

@@ -75,2 +95,6 @@

case 'starPath':
this.starPath = !!options[k]
break
case 'maxBody':

@@ -111,2 +135,8 @@ case 'addIP':

tmp.path = tmp.path.trim().replace(/(\/){2,}/g, '/')
if (tmp.path.length > 2 && tmp.path[tmp.path.length - 1] === '/') {
tmp.path = tmp.substring(0, tmp.path.length-1)
}
if (tmp.url === undefined) {

@@ -160,2 +190,5 @@ console.error(`${k} ${tmp.path}:没有指定要代理转发的url。`)

if (tmp.rewrite && typeof tmp.rewrite === 'function')
backend_obj.rewrite = tmp.rewrite
}

@@ -188,2 +221,4 @@

path : tmp.path,
pathLength: tmp.path.length,
rewrite: false,
weight: 1,

@@ -346,2 +381,7 @@ weightCount : 0,

if (pr.rewrite) {
let rpath = pr.rewrite(c, c.headers[':path'])
if (rpath) c.headers[':path'] = rpath
}
let stm = hii.session.request(c.headers)

@@ -413,23 +453,3 @@

function fmtpath (path) {
path = path.trim()
if (path.length == 0) {
return '/*'
}
if (path[0] !== '/') {
path = `/${path}`
}
if (path.length > 1 && path[path.length - 1] !== '/') {
path = `${path}/`
}
if (path.indexOf('/:') >= 0) {
return path.substring(0, path.length-1)
}
return `${path}*`
}
module.exports = hiiproxy
{
"name": "gohttp",
"version": "5.0.2",
"version": "5.0.3-beta",
"description": "http & https client for HTTP/1.1 and HTTP/2",

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