Skip to content

Commit

Permalink
fix: make options optional in fetchr client just as in server (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
pablopalacios authored Jul 16, 2024
1 parent fd48fef commit 892783d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions libs/fetcher.client.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,19 +174,19 @@ Request.prototype.end = function (callback) {
* the stats object, which contains resource, operation, params (request params),
* statusCode, err, and time (elapsed time)
*/

function Fetcher(options) {
var opts = options || {};
this._serviceMeta = [];
this.options = {
headers: options.headers,
xhrPath: options.xhrPath || DEFAULT_PATH,
xhrTimeout: options.xhrTimeout || DEFAULT_TIMEOUT,
corsPath: options.corsPath,
context: options.context || {},
contextPicker: options.contextPicker || {},
retry: options.retry || null,
statsCollector: options.statsCollector,
unsafeAllowRetry: Boolean(options.unsafeAllowRetry),
headers: opts.headers,
xhrPath: opts.xhrPath || DEFAULT_PATH,
xhrTimeout: opts.xhrTimeout || DEFAULT_TIMEOUT,
corsPath: opts.corsPath,
context: opts.context || {},
contextPicker: opts.contextPicker || {},
retry: opts.retry || null,
statsCollector: opts.statsCollector,
unsafeAllowRetry: Boolean(opts.unsafeAllowRetry),
_serviceMeta: this._serviceMeta,
};
}
Expand Down

0 comments on commit 892783d

Please sign in to comment.