Commit c80a5526 authored by antoor's avatar antoor

Add ignore-https switch

增加忽略HTTPS证书选项
parent 05ecc277
......@@ -91,15 +91,17 @@ class Request {
* @return {[type]} [description]
*/
onRequest(event, opts) {
logger.debug('onRequest::opts', opts);
logger.debug('onRequest::url', opts['url']);
logger.debug('onRequest::data', opts['data']);
superagent
.post(opts['url'])
.set('User-Agent', USER_AGENT)
.proxy(APROXY_CONF['uri'])
.type('form')
// 超时
.timeout(REQ_TIMEOUT)
// 忽略HTTPS
.ignoreHTTPS(opts['ignoreHTTPS'])
.send(opts['data'])
.parse((res, callback) => {
this.parse(opts['tag_s'], opts['tag_e'], (chunk) => {
......@@ -145,6 +147,8 @@ class Request {
.type('form')
// 设置超时会导致文件过大时写入出错
// .timeout(timeout)
// 忽略HTTPS
.ignoreHTTPS(opts['ignoreHTTPS'])
.send(opts['data'])
.pipe(through(
(chunk) => {
......
......@@ -215,7 +215,8 @@ class Base {
data: opt['data'],
tag_s: opt['tag_s'],
tag_e: opt['tag_e'],
encode: this.__opts__['encode']
encode: this.__opts__['encode'],
ignoreHTTPS: (this.__opts__['otherConf'] || {})['ignore-https'] === 1
});
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment