aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-10-22 19:36:22 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-10-22 19:36:22 -0400
commitb54046a6dedf691e33b273d5aa105910efee3c7e (patch)
tree8701246c6a4e55bb92348f92a18324c8fa582c3d /Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
parentc2361db772591e176fcf2ded2e3b1725cf1c5dd7 (diff)
adjust header values
Diffstat (limited to 'Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs')
-rw-r--r--Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs13
1 files changed, 6 insertions, 7 deletions
diff --git a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
index ae53e3a5b..ef95b47c3 100644
--- a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
+++ b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
@@ -397,17 +397,16 @@ namespace Emby.Server.Implementations.HttpClientManager
{
try
{
- var bytes = options.RequestContentBytes ??
- Encoding.UTF8.GetBytes(options.RequestContent ?? string.Empty);
+ // TODO: We can always put this in the options object if needed
+ var requestEncoding = Encoding.UTF8;
+
+ var bytes = options.RequestContentBytes ?? requestEncoding.GetBytes(options.RequestContent ?? string.Empty);
var contentType = options.RequestContentType ?? "application/x-www-form-urlencoded";
- if (options.RequestContentEncoding != null)
+ if (options.AppendCharsetToMimeType)
{
- if (options.RequestContentEncoding.Equals(Encoding.UTF8))
- {
- contentType = contentType.TrimEnd(';') + "; charset=\"utf-8\"";
- }
+ contentType = contentType.TrimEnd(';') + "; charset=\"utf-8\"";
}
httpWebRequest.ContentType = contentType;