steamutils 1.0.24 → 1.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,8 +2,8 @@
2
2
  <module type="WEB_MODULE" version="4">
3
3
  <component name="NewModuleRootManager">
4
4
  <content url="file://$MODULE_DIR$">
5
- <excludeFolder url="file://$MODULE_DIR$/temp" />
6
5
  <excludeFolder url="file://$MODULE_DIR$/.tmp" />
6
+ <excludeFolder url="file://$MODULE_DIR$/temp" />
7
7
  <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
8
  </content>
9
9
  <orderEntry type="inheritedJdk" />
package/.idea/vcs.xml CHANGED
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <project version="4">
3
3
  <component name="VcsDirectoryMappings">
4
- <mapping directory="$PROJECT_DIR$" vcs="Git" />
4
+ <mapping directory="" vcs="Git" />
5
5
  </component>
6
6
  </project>
package/index.js CHANGED
@@ -1094,11 +1094,12 @@ class SteamUser {
1094
1094
  baseURL: SteamcommunityURL, ...params,
1095
1095
  data: typeof params.data === 'object' && !Object.keys(params.data).length ? undefined : params.data,
1096
1096
  headers: params.headers.get(),
1097
- beforeRedirect: (options, {headers}) => {
1098
- if(options.hostname === 'steamcommunity.com') {
1097
+ beforeRedirect: (options) => {
1098
+ options.headers = options.headers || {}
1099
+ if (options?.hostname === 'steamcommunity.com') {
1099
1100
  options.headers.cookie = this._cookies
1100
1101
  }
1101
- if(headers.location.startsWith('https://login.steampowered.com/jwt/refresh')) {
1102
+ if (options.headers.location?.startsWith('https://login.steampowered.com/jwt/refresh')) {
1102
1103
  //should login first
1103
1104
  }
1104
1105
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "dependencies": {
5
5
  "axios": "^1.3.4",
6
6
  "cheerio": "^1.0.0-rc.12",
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="JavaScriptLibraryMappings">
4
- <includedPredefinedLibrary name="Node.js Core" />
5
- </component>
6
- </project>