Skip to content

Commit

Permalink
Merge pull request #2959 from AzureAD/axios-validate-status
Browse files Browse the repository at this point in the history
Set the validateStatus locally than globally for `axios`
  • Loading branch information
sameerag authored Feb 7, 2021
2 parents 5cc21a9 + f123486 commit 2b2cd49
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "prerelease",
"comment": "Set the validateStatus locally than globally for `axios` (#2959)",
"packageName": "@azure/msal-node",
"email": "sameera.gajjarapu@microsoft.com",
"dependentChangeType": "patch",
"date": "2021-01-31T05:38:37.318Z"
}
5 changes: 2 additions & 3 deletions lib/msal-node/src/network/HttpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ import axios, { AxiosRequestConfig } from "axios";
* This class implements the API for network requests.
*/
export class HttpClient implements INetworkModule {
constructor() {
axios.defaults.validateStatus = () => true;
}

/**
* Http Get request
Expand All @@ -32,6 +29,7 @@ export class HttpClient implements INetworkModule {
method: HttpMethod.GET,
url: url,
headers: options && options.headers,
validateStatus: () => true
};

const response = await axios(request);
Expand All @@ -56,6 +54,7 @@ export class HttpClient implements INetworkModule {
url: url,
data: (options && options.body) || "",
headers: options && options.headers,
validateStatus: () => true
};

const response = await axios(request);
Expand Down

0 comments on commit 2b2cd49

Please sign in to comment.