Add workaround for POST limit size

This commit is contained in:
JustArchi
2020-02-24 21:11:54 +01:00
parent 1494e96ed3
commit ff3ecad6d1
2 changed files with 4 additions and 5 deletions

View File

@@ -35,7 +35,7 @@ using SteamKit2;
namespace ArchiSteamFarm {
public sealed class Trading : IDisposable {
internal const byte MaxItemsPerTrade = byte.MaxValue; // This is decided upon various factors, mainly limit on POST size in WebBrowser, as well as stability of Steam servers when dealing with huge trade offers
internal const byte MaxItemsPerTrade = byte.MaxValue; // This is decided upon various factors, mainly stability of Steam servers when dealing with huge trade offers
internal const byte MaxTradesPerAccount = 5; // This is limit introduced by Valve
private readonly Bot Bot;

View File

@@ -22,6 +22,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
@@ -553,10 +554,8 @@ namespace ArchiSteamFarm {
if (data != null) {
try {
request.Content = new FormUrlEncodedContent(data);
} catch (UriFormatException e) {
ArchiLogger.LogGenericException(e);
return null;
} catch (UriFormatException) {
request.Content = new StringContent(string.Join("&", data.Select(kv => WebUtility.UrlEncode(kv.Key) + "=" + WebUtility.UrlEncode(kv.Value))), null, "application/x-www-form-urlencoded");
}
}