Skip to content

Commit

Permalink
Clean up upgradeRequest method signature
Browse files Browse the repository at this point in the history
  • Loading branch information
gempesaw committed Sep 16, 2018
1 parent 973baf6 commit 201f9c1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,11 @@ function buildExecQueryParams(qs) {

/**
* Upgrade a request into a Websocket transaction & process the result
* @param {string} method - HTTP method, passed directly to `request`
* @param {ApiRequestOptions} options - Options object
* @param {callback} cb - The callback that handles the response
*/

function upgradeRequest(method, options, cb) {
function upgradeRequest(options, cb) {
const qs = buildExecQueryParams(options.qs);

const wsUrl = `${options.baseUrl}/${options.uri}?${qs}`;
Expand Down Expand Up @@ -187,7 +186,7 @@ class Request {
if (err) return cb(err);

if (isUpgradeRequired(body)) {
return upgradeRequest(method, requestOptions, cb);
return upgradeRequest(requestOptions, cb);
}

// Refresh auth if 401
Expand Down

0 comments on commit 201f9c1

Please sign in to comment.