From 67b536c53b6ad37b4011349db7a25c1f086cdf76 Mon Sep 17 00:00:00 2001 From: huangapple Date: Thu, 8 Dec 2022 16:18:24 +0800 Subject: [PATCH] test --- .../http-proxy/test/fixtures/express/src/configuration.ts | 7 ++++++- .../http-proxy/test/fixtures/faas/src/configuration.ts | 7 ++++++- .../http-proxy/test/fixtures/koa/src/configuration.ts | 7 ++++++- .../test/fixtures/web/src/config/config.default.ts | 8 +++++++- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/packages/http-proxy/test/fixtures/express/src/configuration.ts b/packages/http-proxy/test/fixtures/express/src/configuration.ts index 216b1101cdc..9cf09ecde97 100644 --- a/packages/http-proxy/test/fixtures/express/src/configuration.ts +++ b/packages/http-proxy/test/fixtures/express/src/configuration.ts @@ -1,6 +1,7 @@ import { All, Configuration, Controller, Inject } from '@midwayjs/core'; import * as express from '@midwayjs/express'; import * as proxy from '../../../../src'; +import * as https from "https"; @Configuration({ imports: [ @@ -38,11 +39,15 @@ import * as proxy from '../../../../src'; extReqOptions: { //表示不重定义 maxRedirects: 0, + httpsAgent: new https.Agent({ rejectUnauthorized: false }) } }, f: { match: /.*?can302.*$/, - target: 'https://www.302.com/' + target: 'https://www.302.com/', + extReqOptions: { + httpsAgent: new https.Agent({ rejectUnauthorized: false }) + } } } }, diff --git a/packages/http-proxy/test/fixtures/faas/src/configuration.ts b/packages/http-proxy/test/fixtures/faas/src/configuration.ts index 2301a9c8ba5..82b374b4ff2 100644 --- a/packages/http-proxy/test/fixtures/faas/src/configuration.ts +++ b/packages/http-proxy/test/fixtures/faas/src/configuration.ts @@ -1,6 +1,7 @@ import { Configuration, Provide, ServerlessTrigger, ServerlessTriggerType } from '@midwayjs/core'; import * as faas from '@midwayjs/faas'; import * as proxy from '../../../../src'; +import https from "https"; @Configuration({ imports: [ @@ -37,11 +38,15 @@ import * as proxy from '../../../../src'; extReqOptions: { //表示不重定义 maxRedirects: 0, + httpsAgent: new https.Agent({ rejectUnauthorized: false }) } }, f: { match: /.*?can302.*$/, - target: 'https://www.302.com/' + target: 'https://www.302.com/', + extReqOptions: { + httpsAgent: new https.Agent({ rejectUnauthorized: false }) + } } } } diff --git a/packages/http-proxy/test/fixtures/koa/src/configuration.ts b/packages/http-proxy/test/fixtures/koa/src/configuration.ts index 1bbb87d85e5..22458058e42 100644 --- a/packages/http-proxy/test/fixtures/koa/src/configuration.ts +++ b/packages/http-proxy/test/fixtures/koa/src/configuration.ts @@ -1,6 +1,7 @@ import { Configuration } from '@midwayjs/core'; import * as koa from '@midwayjs/koa'; import * as proxy from '../../../../src'; +import https from "https"; @Configuration({ imports: [ @@ -38,11 +39,15 @@ import * as proxy from '../../../../src'; extReqOptions: { //表示不重定义 maxRedirects: 0, + httpsAgent: new https.Agent({ rejectUnauthorized: false }) } }, f: { match: /.*?can302.*$/, - target: 'https://www.302.com/' + target: 'https://www.302.com/', + extReqOptions: { + httpsAgent: new https.Agent({ rejectUnauthorized: false }) + } } } } diff --git a/packages/http-proxy/test/fixtures/web/src/config/config.default.ts b/packages/http-proxy/test/fixtures/web/src/config/config.default.ts index 15defe5f6cb..3366002be8f 100644 --- a/packages/http-proxy/test/fixtures/web/src/config/config.default.ts +++ b/packages/http-proxy/test/fixtures/web/src/config/config.default.ts @@ -1,3 +1,5 @@ +import https from "https"; + export const keys = 'test'; export const httpProxy = { strategy: { @@ -26,11 +28,15 @@ export const httpProxy = { extReqOptions: { //表示不重定义 maxRedirects: 0, + httpsAgent: new https.Agent({ rejectUnauthorized: false }) } }, f: { match: /.*?can302.*$/, - target: 'https://www.302.com/' + target: 'https://www.302.com/', + extReqOptions: { + httpsAgent: new https.Agent({ rejectUnauthorized: false }) + } } }, };