Skip to content

Commit

Permalink
feat: Added the ability to add sudo to specific requests
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalrymple committed May 25, 2019
1 parent 5f97193 commit 18effa2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/infrastructure/BaseService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class BaseModel {
else if (token) this.headers['private-token'] = token;

// Set sudo
if (sudo) this.headers['Sudo'] = sudo;
if (sudo) this.headers['Sudo'] = `${sudo}`;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/infrastructure/RequestHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function defaultRequest(
const params: RequestParametersOutput = {
url: URLJoin(url, endpoint),
headers,
json: true,
sudo,
};

if (body) params.body = Humps.decamelizeKeys(body);
Expand Down

0 comments on commit 18effa2

Please sign in to comment.