mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-08-04 07:10:45 +00:00
adjust header values
This commit is contained in:
parent
c2361db772
commit
b54046a6de
4 changed files with 9 additions and 10 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue