From 489c1fbf536cc1691d52d57ab5ab30a6470e2d0b Mon Sep 17 00:00:00 2001 From: grandsilence Date: Sat, 3 Nov 2018 22:37:59 +0300 Subject: [PATCH] New property AcceptEncoding. Some servers using custom AcceptEncoding format: like "gzip,deflate" (without space). Chromium and Firefox using space version. --- Leaf.xNet/~Http/HttpRequest.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Leaf.xNet/~Http/HttpRequest.cs b/Leaf.xNet/~Http/HttpRequest.cs index 8a70938..f2d4832 100644 --- a/Leaf.xNet/~Http/HttpRequest.cs +++ b/Leaf.xNet/~Http/HttpRequest.cs @@ -259,6 +259,11 @@ public event EventHandler DownloadProgressChan /// public bool EnableMiddleHeaders { get; set; } + /// + /// Заголовок AcceptEncoding. Стоит обратить внимание что не все сайты принимают версию с пробелом: "gzip, deflate". + /// + public string AcceptEncoding { get; set; } = "gzip,deflate"; + #region Поведение /// @@ -2076,7 +2081,7 @@ private Dictionary GenerateCommonHeaders(HttpMethod method, long #region Content if (EnableEncodingContent) - headers["Accept-Encoding"] = "gzip, deflate"; + headers["Accept-Encoding"] = AcceptEncoding; if (Culture != null) headers["Accept-Language"] = GetLanguageHeader();