diff --git a/OpenBullet/Pages/Main/Configs/OtherOptions/ConfigOtherOptionsRequests.xaml b/OpenBullet/Pages/Main/Configs/OtherOptions/ConfigOtherOptionsRequests.xaml index 498dfc0..6a8ca67 100644 --- a/OpenBullet/Pages/Main/Configs/OtherOptions/ConfigOtherOptionsRequests.xaml +++ b/OpenBullet/Pages/Main/Configs/OtherOptions/ConfigOtherOptionsRequests.xaml @@ -4,14 +4,22 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:OpenBullet" + xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="780" Title="ConfigOtherOptionsRequests"> + + + + + - - + + + diff --git a/RuriLib/Blocks/BlockBase.cs b/RuriLib/Blocks/BlockBase.cs index 94df919..22c75fd 100644 --- a/RuriLib/Blocks/BlockBase.cs +++ b/RuriLib/Blocks/BlockBase.cs @@ -287,6 +287,7 @@ namespace RuriLib /// The name of the variable to create /// The string to add at the start of the value /// The string to add at the end of the value + /// Whether to URLencode the values before creating the variables public static void InsertVariables(BotData data, bool isCapture, bool recursive, List values, string variableName, string prefix, string suffix, bool urlEncode) { var list = values.Select(v => ReplaceValues(prefix, data) + v.Trim() + ReplaceValues(suffix, data)).ToList(); diff --git a/RuriLib/Blocks/BlockRequest.cs b/RuriLib/Blocks/BlockRequest.cs index e8bc76b..a188590 100644 --- a/RuriLib/Blocks/BlockRequest.cs +++ b/RuriLib/Blocks/BlockRequest.cs @@ -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('=')) diff --git a/RuriLib/Models/ConfigSettings.cs b/RuriLib/Models/ConfigSettings.cs index 6ca4506..86c4f0e 100644 --- a/RuriLib/Models/ConfigSettings.cs +++ b/RuriLib/Models/ConfigSettings.cs @@ -42,6 +42,10 @@ namespace RuriLib private bool ignoreResponseErrors = false; /// Whether to proceed if an HTTP request fails instead of giving the ERROR status. public bool IgnoreResponseErrors { get { return ignoreResponseErrors; } set { ignoreResponseErrors = value; OnPropertyChanged(); } } + + private int _maxRedirects = 8; + /// The maximum amount of times we can be redirected to different URLs for a single request. + public int MaxRedirects { get { return _maxRedirects; } set { _maxRedirects = value; OnPropertyChanged(); } } #endregion #region Proxy