steamutils 1.1.84 → 1.1.86
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +16 -2
- package/package.json +1 -1
package/index.js
CHANGED
@@ -1569,6 +1569,14 @@ class SteamUser {
|
|
1569
1569
|
config.headers['Content-Type'] = config.headers['content-type'] = 'multipart/form-data'
|
1570
1570
|
retry = 1
|
1571
1571
|
}
|
1572
|
+
} else if (response.status === 400) {
|
1573
|
+
console.log('Error', response.status, config.url)
|
1574
|
+
if (params.method.toUpperCase() === 'POST') {
|
1575
|
+
config.headers['Content-Type'] = config.headers['content-type'] = 'application/x-www-form-urlencoded'
|
1576
|
+
retry = 1
|
1577
|
+
}
|
1578
|
+
} else if (response.status === 500) {
|
1579
|
+
console.log(response.status, response.statusText, config.url, response.data)
|
1572
1580
|
} else {
|
1573
1581
|
console.log(response.status, config.url);
|
1574
1582
|
}
|
@@ -2645,12 +2653,15 @@ class SteamUser {
|
|
2645
2653
|
|
2646
2654
|
//{ invited: [ '76561199277912057' ], success: 1 }
|
2647
2655
|
async addFriendUser (steamID) {
|
2648
|
-
const { data } = await this.
|
2656
|
+
const { data } = await this._httpRequestAjax({
|
2649
2657
|
url: `actions/AddFriendAjax`,
|
2650
2658
|
data: {
|
2651
2659
|
steamid: steamID,
|
2652
2660
|
accept_invite: 0,
|
2653
2661
|
},
|
2662
|
+
headers: {
|
2663
|
+
'content-type': 'application/x-www-form-urlencoded'
|
2664
|
+
},
|
2654
2665
|
method: 'POST',
|
2655
2666
|
})
|
2656
2667
|
|
@@ -2659,11 +2670,14 @@ class SteamUser {
|
|
2659
2670
|
|
2660
2671
|
//true, false boolean
|
2661
2672
|
async removeFriend (steamID) {
|
2662
|
-
const { data } = await this.
|
2673
|
+
const { data } = await this._httpRequestAjax({
|
2663
2674
|
url: `actions/RemoveFriendAjax`,
|
2664
2675
|
data: {
|
2665
2676
|
steamid: steamID,
|
2666
2677
|
},
|
2678
|
+
headers: {
|
2679
|
+
'content-type': 'application/x-www-form-urlencoded'
|
2680
|
+
},
|
2667
2681
|
method: 'POST',
|
2668
2682
|
})
|
2669
2683
|
return data
|