修正方法名中的单词错误:`Form` -> `From`
parent
3048ae7ff1
commit
d513442c49
|
@ -19,7 +19,7 @@ let socketId = 0
|
||||||
|
|
||||||
let httpsOverHttpAgent, httpOverHttpsAgent, httpsOverHttpsAgent
|
let httpsOverHttpAgent, httpOverHttpsAgent, httpsOverHttpsAgent
|
||||||
|
|
||||||
util.getOptionsFormRequest = (req, ssl, externalProxy = null) => {
|
util.getOptionsFromRequest = (req, ssl, externalProxy = null) => {
|
||||||
// eslint-disable-next-line node/no-deprecated-api
|
// eslint-disable-next-line node/no-deprecated-api
|
||||||
const urlObject = url.parse(req.url)
|
const urlObject = url.parse(req.url)
|
||||||
const defaultPort = ssl ? 443 : 80
|
const defaultPort = ssl ? 443 : 80
|
||||||
|
|
|
@ -15,7 +15,7 @@ module.exports = function createRequestHandler (createIntercepts, middlewares, e
|
||||||
return function requestHandler (req, res, ssl) {
|
return function requestHandler (req, res, ssl) {
|
||||||
let proxyReq
|
let proxyReq
|
||||||
|
|
||||||
const rOptions = commonUtil.getOptionsFormRequest(req, ssl, externalProxy)
|
const rOptions = commonUtil.getOptionsFromRequest(req, ssl, externalProxy)
|
||||||
|
|
||||||
if (rOptions.agent) {
|
if (rOptions.agent) {
|
||||||
rOptions.agent.options.rejectUnauthorized = setting.verifySsl
|
rOptions.agent.options.rejectUnauthorized = setting.verifySsl
|
||||||
|
|
|
@ -8,7 +8,7 @@ const log = require('../../../utils/util.log')
|
||||||
module.exports = function createUpgradeHandler () {
|
module.exports = function createUpgradeHandler () {
|
||||||
// return
|
// return
|
||||||
return function upgradeHandler (req, cltSocket, head, ssl) {
|
return function upgradeHandler (req, cltSocket, head, ssl) {
|
||||||
const clientOptions = util.getOptionsFormRequest(req, ssl)
|
const clientOptions = util.getOptionsFromRequest(req, ssl)
|
||||||
const proxyReq = (ssl ? https : http).request(clientOptions)
|
const proxyReq = (ssl ? https : http).request(clientOptions)
|
||||||
proxyReq.on('error', (e) => {
|
proxyReq.on('error', (e) => {
|
||||||
log.error('upgradeHandler', e)
|
log.error('upgradeHandler', e)
|
||||||
|
|
Loading…
Reference in New Issue