@podium/client
Advanced tools
Comparing version 4.4.33 to 4.5.0
@@ -0,1 +1,8 @@ | ||
# [4.5.0](https://github.com/podium-lib/client/compare/v4.4.33...v4.5.0) (2021-07-19) | ||
### Features | ||
* Support mixed protocols ([#228](https://github.com/podium-lib/client/issues/228)) ([f1e42fe](https://github.com/podium-lib/client/commit/f1e42feb298e755b1274e5cf79cf77243457c538)) | ||
## [4.4.33](https://github.com/podium-lib/client/compare/v4.4.32...v4.4.33) (2021-07-16) | ||
@@ -2,0 +9,0 @@ |
@@ -40,2 +40,4 @@ /* eslint-disable import/order */ | ||
const REJECT_UNAUTHORIZED = true; | ||
const HTTP_AGENT = new http.Agent(HTTP_AGENT_OPTIONS); | ||
@@ -88,2 +90,3 @@ | ||
maxAge: MAX_AGE, | ||
rejectUnauthorized: REJECT_UNAUTHORIZED, | ||
httpAgent: HTTP_AGENT, | ||
@@ -186,2 +189,3 @@ httpsAgent: HTTPS_AGENT, | ||
const resourceOptions = { | ||
rejectUnauthorized: this[_options].rejectUnauthorized, | ||
clientName: this[_options].name, | ||
@@ -192,5 +196,4 @@ retries: this[_options].retries, | ||
maxAge: this[_options].maxAge, | ||
agent: options.uri.startsWith('https://') | ||
? this[_options].httpsAgent | ||
: this[_options].httpAgent, | ||
httpsAgent: this[_options].httpsAgent, | ||
httpAgent: this[_options].httpAgent, | ||
...options, | ||
@@ -197,0 +200,0 @@ }; |
@@ -9,2 +9,3 @@ /* eslint-disable no-underscore-dangle */ | ||
const _rejectUnauthorized = Symbol('podium:httpoutgoing:rejectUnauthorized'); | ||
const _killRecursions = Symbol('podium:httpoutgoing:killrecursions'); | ||
@@ -31,2 +32,3 @@ const _killThreshold = Symbol('podium:httpoutgoing:killthreshold'); | ||
{ | ||
rejectUnauthorized = true, | ||
resolveCss = false, | ||
@@ -52,2 +54,5 @@ resolveJs = false, | ||
// If requests to https sites should reject on unsigned sertificates | ||
this[_rejectUnauthorized] = rejectUnauthorized; | ||
// A HttpIncoming object | ||
@@ -121,2 +126,6 @@ this[_incoming] = utils.validateIncoming(incoming); | ||
get rejectUnauthorized() { | ||
return this[_rejectUnauthorized]; | ||
} | ||
get reqOptions() { | ||
@@ -123,0 +132,0 @@ return this[_reqOptions]; |
@@ -33,6 +33,10 @@ /* eslint-disable no-param-reassign */ | ||
Object.defineProperty(this, 'agent', { | ||
value: options.agent, | ||
Object.defineProperty(this, 'httpsAgent', { | ||
value: options.httpsAgent, | ||
}); | ||
Object.defineProperty(this, 'httpAgent', { | ||
value: options.httpAgent, | ||
}); | ||
this.metrics.on('error', error => { | ||
@@ -113,5 +117,8 @@ this.log.error( | ||
const reqOptions = { | ||
rejectUnauthorized: outgoing.rejectUnauthorized, | ||
timeout: outgoing.timeout, | ||
method: 'GET', | ||
agent: this.agent, | ||
agent: outgoing.contentUri.startsWith('https://') | ||
? this.httpsAgent | ||
: this.httpAgent, | ||
uri: putils.uriBuilder( | ||
@@ -118,0 +125,0 @@ outgoing.reqOptions.pathname, |
@@ -28,6 +28,10 @@ /* eslint-disable no-param-reassign */ | ||
Object.defineProperty(this, 'agent', { | ||
value: options.agent, | ||
Object.defineProperty(this, 'httpsAgent', { | ||
value: options.httpsAgent, | ||
}); | ||
Object.defineProperty(this, 'httpAgent', { | ||
value: options.httpAgent, | ||
}); | ||
this.metrics.on('error', error => { | ||
@@ -88,5 +92,8 @@ this.log.error( | ||
const reqOptions = { | ||
rejectUnauthorized: outgoing.rejectUnauthorized, | ||
timeout: outgoing.timeout, | ||
method: 'GET', | ||
agent: this.agent, | ||
agent: outgoing.fallbackUri.startsWith('https://') | ||
? this.httpsAgent | ||
: this.httpAgent, | ||
uri: outgoing.fallbackUri, | ||
@@ -93,0 +100,0 @@ headers, |
@@ -31,6 +31,10 @@ /* eslint-disable no-param-reassign */ | ||
Object.defineProperty(this, 'agent', { | ||
value: options.agent, | ||
Object.defineProperty(this, 'httpsAgent', { | ||
value: options.httpsAgent, | ||
}); | ||
Object.defineProperty(this, 'httpAgent', { | ||
value: options.httpAgent, | ||
}); | ||
this.metrics.on('error', error => { | ||
@@ -71,5 +75,8 @@ this.log.error( | ||
const reqOptions = { | ||
rejectUnauthorized: outgoing.rejectUnauthorized, | ||
timeout: outgoing.timeout, | ||
method: 'GET', | ||
agent: this.agent, | ||
agent: outgoing.manifestUri.startsWith('https://') | ||
? this.httpsAgent | ||
: this.httpAgent, | ||
json: true, | ||
@@ -76,0 +83,0 @@ uri: outgoing.manifestUri, |
{ | ||
"name": "@podium/client", | ||
"version": "4.4.33", | ||
"version": "4.5.0", | ||
"main": "lib/client.js", | ||
@@ -50,3 +50,3 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@podium/test-utils": "2.3.0", | ||
"@podium/test-utils": "2.4.1", | ||
"@semantic-release/changelog": "5.0.1", | ||
@@ -58,6 +58,6 @@ "@semantic-release/commit-analyzer": "8.0.1", | ||
"@semantic-release/release-notes-generator": "9.0.3", | ||
"semantic-release": "17.4.2", | ||
"@sinonjs/fake-timers": "7.0.5", | ||
"semantic-release": "17.4.4", | ||
"@sinonjs/fake-timers": "7.1.2", | ||
"benchmark": "2.1.4", | ||
"eslint": "7.27.0", | ||
"eslint": "7.30.0", | ||
"eslint-config-airbnb-base": "14.2.1", | ||
@@ -68,8 +68,8 @@ "eslint-config-prettier": "8.3.0", | ||
"express": "4.17.1", | ||
"get-stream": "6.0.0", | ||
"get-stream": "6.0.1", | ||
"http-proxy": "1.18.1", | ||
"is-stream": "2.0.0", | ||
"prettier": "2.2.1", | ||
"prettier": "2.3.2", | ||
"tap": "15.0.9" | ||
} | ||
} |
93989
1554