Skip to content

Commit

Permalink
added .fetchOptions to Exchange.js
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Jun 3, 2018
1 parent 0b3ac3d commit dae8e71
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/base/Exchange.js
Expand Up @@ -169,6 +169,7 @@ module.exports = class Exchange {
// }

this.options = {} // exchange-specific options, if any
this.fetchOptions = {} // fetch implementation options (JS only)

this.userAgents = {
'chrome': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36',
Expand Down Expand Up @@ -314,7 +315,7 @@ module.exports = class Exchange {
this.executeRestRequest = function (url, method = 'GET', headers = undefined, body = undefined) {

let promise =
fetchImplementation (url, { method, headers, body, 'agent': this.agent || null, timeout: this.timeout })
fetchImplementation (url, { method, headers, body, 'agent': this.agent || null, timeout: this.timeout, ... this.fetchOptions })
.catch (e => {
if (isNode)
throw new ExchangeNotAvailable ([ this.id, method, url, e.type, e.message ].join (' '))
Expand Down

0 comments on commit dae8e71

Please sign in to comment.