Commit 05374d66 authored by antoor's avatar antoor

Add request-timeout features

添加HTTP请求超时功能
parent d91fdba5
...@@ -106,7 +106,7 @@ class Request { ...@@ -106,7 +106,7 @@ class Request {
.proxy(APROXY_CONF['uri']) .proxy(APROXY_CONF['uri'])
.type('form') .type('form')
// 超时 // 超时
.timeout(REQ_TIMEOUT) .timeout(opts.timeout || REQ_TIMEOUT)
// 忽略HTTPS // 忽略HTTPS
.ignoreHTTPS(opts['ignoreHTTPS']) .ignoreHTTPS(opts['ignoreHTTPS'])
.send(_postData) .send(_postData)
......
...@@ -240,6 +240,7 @@ class Base { ...@@ -240,6 +240,7 @@ class Base {
tag_e: opt['tag_e'], tag_e: opt['tag_e'],
encode: this.__opts__['encode'], encode: this.__opts__['encode'],
ignoreHTTPS: (this.__opts__['otherConf'] || {})['ignore-https'] === 1, ignoreHTTPS: (this.__opts__['otherConf'] || {})['ignore-https'] === 1,
timeout: (this.__opts__['otherConf'] || {})['request-timeout'],
headers: (this.__opts__['httpConf'] || {})['headers'] || {}, headers: (this.__opts__['httpConf'] || {})['headers'] || {},
body: (this.__opts__['httpConf'] || {})['body'] || {} body: (this.__opts__['httpConf'] || {})['body'] || {}
}); });
......
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