steamutils 1.0.24 → 1.0.26
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.
- package/.idea/steamutils.iml +1 -1
- package/.idea/vcs.xml +1 -1
- package/axios.js +1 -1
- package/index.js +4 -3
- package/package.json +1 -1
- package/.idea/jsLibraryMappings.xml +0 -6
package/.idea/steamutils.iml
CHANGED
@@ -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
package/axios.js
CHANGED
@@ -13,7 +13,7 @@ export class Header {
|
|
13
13
|
|
14
14
|
validate(headers) {
|
15
15
|
headers = Object.keys(headers).reduce(function (previousValue, currentValue, currentIndex, array) {
|
16
|
-
previousValue[currentValue.toLowerCase()] = headers[currentValue]
|
16
|
+
previousValue[currentValue.toLowerCase()] = headers[currentValue]?.trim()
|
17
17
|
return previousValue
|
18
18
|
}, {})
|
19
19
|
if(headers.cookie === undefined || headers.cookie === null) {
|
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
|
1098
|
-
|
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
|
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