Skip to content

Commit

Permalink
fix: fetchUser with lang & axios@1.2.1 error
Browse files Browse the repository at this point in the history
  • Loading branch information
kravetsone committed Dec 26, 2022
1 parent fc9ed63 commit 8ed7918
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "enkanetwork",
"version": "1.2.4",
"version": "1.2.5",
"description": "NodeJS/TypeScript api wrapper data from https://enka.network/",
"main": "./dist/index.js",
"module": "./dist/index.js",
Expand Down Expand Up @@ -33,7 +33,11 @@
},
"homepage": "https://github.com/kravetsone/enkaNetwork#readme",
"dependencies": {
"axios": "^1.1.2",
"axios": "^1.2.1",
"node-cache": "^5.1.2"
}
},
"files": [
"assets/",
"dist/"
]
}
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class EnkaNetwork {
"User-Agent":
typeof data.userAgent == "string"
? data.userAgent
: "enkaNetwork@1.2.4",
: "enkaNetwork@1.2.5",
}),
},
});
Expand All @@ -42,7 +42,9 @@ export class EnkaNetwork {
);
if (cache) return cache;
return this.request
.get(`/u/${uid}/__data.json`)
.get(`/u/${uid}/__data.json`, {
headers: { "Accept-Encoding": "gzip,deflate,compress" }, //waiting for a fix (https://github.com/axios/axios/issues/5346)
})
.then((response) => JSON.parse(response.data))
.then((data) => {
const res = new FetchUserUID(language || this.language, data);
Expand Down

0 comments on commit 8ed7918

Please sign in to comment.