diff --git a/Extreme.Net.dll b/Extreme.Net.dll index fadd81b..a427744 100644 Binary files a/Extreme.Net.dll and b/Extreme.Net.dll differ diff --git a/OpenBullet/LSDoc.xml b/OpenBullet/LSDoc.xml index 4b0fa67..9cd5244 100644 --- a/OpenBullet/LSDoc.xml +++ b/OpenBullet/LSDoc.xml @@ -271,7 +271,7 @@ KEYCHECK BanOnToCheck=False This will spawn and execute a Request Block. Syntax (expanded for readability): -REQUEST METHOD "URL" [AutoRedirect?] [ReadResponseSource?] [ParseQuery?] [EncodeContent?] +REQUEST METHOD "URL" [AcceptEncoding?] [AutoRedirect?] [ReadResponseSource?] [ParseQuery?] [EncodeContent?] [STANDARD / MULTIPART / BASICAUTH] [CONTENT "postdata"] [CONTENTTYPE "ctype"] diff --git a/OpenBullet/Pages/StackerBlocks/PageBlockRequest.xaml b/OpenBullet/Pages/StackerBlocks/PageBlockRequest.xaml index ff12ee9..dd5d375 100644 --- a/OpenBullet/Pages/StackerBlocks/PageBlockRequest.xaml +++ b/OpenBullet/Pages/StackerBlocks/PageBlockRequest.xaml @@ -25,17 +25,24 @@ + + + + + + + diff --git a/OpenBullet/SyntaxHelper.xml b/OpenBullet/SyntaxHelper.xml index e517958..e3e50d4 100644 --- a/OpenBullet/SyntaxHelper.xml +++ b/OpenBullet/SyntaxHelper.xml @@ -10,7 +10,7 @@ KEYCHECK [BanOn4XX?] [BanOnToCheck?] ]* -REQUEST METHOD "URL" [AutoRedirect?] [ReadResponseSource?] [ParseQuery?] [EncodeContent?] +REQUEST METHOD "URL" [AcceptEncoding?] [AutoRedirect?] [ReadResponseSource?] [ParseQuery?] [EncodeContent?] [STANDARD / MULTIPART / BASICAUTH] [CONTENT "postdata"] [CONTENTTYPE "ctype"] diff --git a/RuriLib/Blocks/BlockRequest.cs b/RuriLib/Blocks/BlockRequest.cs index 796980c..188ef8c 100644 --- a/RuriLib/Blocks/BlockRequest.cs +++ b/RuriLib/Blocks/BlockRequest.cs @@ -111,6 +111,10 @@ namespace RuriLib /// Whether to URL encode the content before sending it. public bool EncodeContent { get { return encodeContent; } set { encodeContent = value; OnPropertyChanged(); } } + private bool acceptEncoding = true; + /// Whether to automatically generate an Accept-Encoding header. + public bool AcceptEncoding { get { return acceptEncoding; } set { acceptEncoding = value; OnPropertyChanged(); } } + // Multipart private string multipartBoundary = ""; /// The boundary that separates multipart contents. @@ -253,6 +257,7 @@ namespace RuriLib .Token("REQUEST") .Token(Method) .Literal(Url) + .Boolean(AcceptEncoding, "AcceptEncoding") .Boolean(AutoRedirect, "AutoRedirect") .Boolean(ReadResponseSource, "ReadResponseSource") .Boolean(ParseQuery, "ParseQuery") @@ -346,7 +351,7 @@ namespace RuriLib var timeout = data.GlobalSettings.General.RequestTimeout * 1000; request.IgnoreProtocolErrors = true; request.AllowAutoRedirect = autoRedirect; - request.EnableEncodingContent = true; + request.EnableEncodingContent = acceptEncoding; request.ReadWriteTimeout = timeout; request.ConnectTimeout = timeout; request.KeepAlive = true; @@ -449,6 +454,7 @@ namespace RuriLib var val = ReplaceValues(header.Value, data); if (replacedKey == "contenttype" && content != null) { continue; } // Disregard additional Content-Type headers + if (replacedKey == "acceptencoding" && acceptEncoding) { continue; } // Disregard additional Accept-Encoding headers // else if (fixedNames.Contains(replacedKey)) request.AddHeader((HttpHeader)Enum.Parse(typeof(HttpHeader), replacedKey, true), val); else request.AddHeader(key, val);