Added an option in Config -> Other Options -> Requests to change the max amount of redirects allowed for the requests in a certain config.

This commit is contained in:
ruri
2019-05-09 00:54:18 +02:00
parent c227ffed2b
commit a2cc07a100
4 changed files with 16 additions and 2 deletions
+1
View File
@@ -287,6 +287,7 @@ namespace RuriLib
/// <param name="variableName">The name of the variable to create</param>
/// <param name="prefix">The string to add at the start of the value</param>
/// <param name="suffix">The string to add at the end of the value</param>
/// <param name="urlEncode">Whether to URLencode the values before creating the variables</param>
public static void InsertVariables(BotData data, bool isCapture, bool recursive, List<string> values, string variableName, string prefix, string suffix, bool urlEncode)
{
var list = values.Select(v => ReplaceValues(prefix, data) + v.Trim() + ReplaceValues(suffix, data)).ToList();
+1
View File
@@ -350,6 +350,7 @@ namespace RuriLib
request.ReadWriteTimeout = timeout;
request.ConnectTimeout = timeout;
request.KeepAlive = true;
request.MaximumAutomaticRedirections = data.ConfigSettings.MaxRedirects;
// Check if it has GET parameters
if (ParseQuery && localUrl.Contains('?') && localUrl.Contains('='))
+4
View File
@@ -42,6 +42,10 @@ namespace RuriLib
private bool ignoreResponseErrors = false;
/// <summary>Whether to proceed if an HTTP request fails instead of giving the ERROR status.</summary>
public bool IgnoreResponseErrors { get { return ignoreResponseErrors; } set { ignoreResponseErrors = value; OnPropertyChanged(); } }
private int _maxRedirects = 8;
/// <summary>The maximum amount of times we can be redirected to different URLs for a single request.</summary>
public int MaxRedirects { get { return _maxRedirects; } set { _maxRedirects = value; OnPropertyChanged(); } }
#endregion
#region Proxy