Comparing version 5.1.1 to 5.1.2
@@ -208,7 +208,9 @@ 'use strict' | ||
let backend_obj = null | ||
let tmp_cfg | ||
for (let k in cfg) { | ||
tmp_cfg = Array.isArray(cfg[k]) ? cfg[k] : [ cfg[k] ] | ||
for (let i = 0; i < cfg[k].length; i++) { | ||
tmp = cfg[k][i] | ||
for (let i = 0; i < tmp_cfg.length; i++) { | ||
tmp = tmp_cfg[i] | ||
@@ -360,3 +362,3 @@ if (!this.checkConfig(tmp, k)) continue | ||
if (self.full) { | ||
return c.send(error_502_text, 502) | ||
return c.status(502).send(error_502_text) | ||
} | ||
@@ -372,4 +374,17 @@ | ||
if (pr === null) | ||
return c.send(error_503_text, 503) | ||
if (pr === null) { | ||
await c.ext.delay(5) | ||
pr = self.getBackend(c, host) | ||
if (!pr) { | ||
await c.ext.delay(15) | ||
pr = self.getBackend(c, host) | ||
if (!pr) { | ||
await c.ext.delay(30) | ||
pr = self.getBackend(c, host) | ||
} | ||
} | ||
if (!pr) return c.status(503).send(error_503_text) | ||
} | ||
} | ||
@@ -458,3 +473,3 @@ | ||
self.debug && console.error(err) | ||
c.send(error_503_text, 503) | ||
c.status(503).send(error_503_text) | ||
} | ||
@@ -466,3 +481,3 @@ | ||
HiiProxy.prototype.init =function (app) { | ||
HiiProxy.prototype.init = function (app) { | ||
app.config.timeout = this.timeout | ||
@@ -469,0 +484,0 @@ |
{ | ||
"name": "gohttp", | ||
"version": "5.1.1", | ||
"version": "5.1.2", | ||
"description": "http & https client for HTTP/1.1 and HTTP/2", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
112000
2101