adjust header values
This commit is contained in:
parent
c2361db772
commit
b54046a6de
|
@ -147,7 +147,7 @@ namespace Emby.Dlna.PlayTo
|
||||||
}
|
}
|
||||||
|
|
||||||
options.RequestContentType = "text/xml";
|
options.RequestContentType = "text/xml";
|
||||||
options.RequestContentEncoding = Encoding.UTF8;
|
options.AppendCharsetToMimeType = true;
|
||||||
options.RequestContent = postData;
|
options.RequestContent = postData;
|
||||||
|
|
||||||
return _httpClient.Post(options);
|
return _httpClient.Post(options);
|
||||||
|
|
|
@ -397,18 +397,17 @@ namespace Emby.Server.Implementations.HttpClientManager
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var bytes = options.RequestContentBytes ??
|
// TODO: We can always put this in the options object if needed
|
||||||
Encoding.UTF8.GetBytes(options.RequestContent ?? string.Empty);
|
var requestEncoding = Encoding.UTF8;
|
||||||
|
|
||||||
|
var bytes = options.RequestContentBytes ?? requestEncoding.GetBytes(options.RequestContent ?? string.Empty);
|
||||||
|
|
||||||
var contentType = options.RequestContentType ?? "application/x-www-form-urlencoded";
|
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;
|
httpWebRequest.ContentType = contentType;
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ namespace MediaBrowser.Common.Net
|
||||||
public bool PreferIpv4 { get; set; }
|
public bool PreferIpv4 { get; set; }
|
||||||
public bool EnableDefaultUserAgent { get; set; }
|
public bool EnableDefaultUserAgent { get; set; }
|
||||||
|
|
||||||
public Encoding RequestContentEncoding { get; set; }
|
public bool AppendCharsetToMimeType { get; set; }
|
||||||
|
|
||||||
private string GetHeaderValue(string name)
|
private string GetHeaderValue(string name)
|
||||||
{
|
{
|
||||||
|
|
|
@ -59,7 +59,7 @@ namespace Mono.Nat.Upnp
|
||||||
req.Url = ss;
|
req.Url = ss;
|
||||||
req.EnableKeepAlive = false;
|
req.EnableKeepAlive = false;
|
||||||
req.RequestContentType = "text/xml";
|
req.RequestContentType = "text/xml";
|
||||||
req.RequestContentEncoding = Encoding.UTF8;
|
req.AppendCharsetToMimeType = true;
|
||||||
req.RequestHeaders.Add("SOAPACTION", "\"" + device.ServiceType + "#" + upnpMethod + "\"");
|
req.RequestHeaders.Add("SOAPACTION", "\"" + device.ServiceType + "#" + upnpMethod + "\"");
|
||||||
|
|
||||||
string bodyString = "<s:Envelope "
|
string bodyString = "<s:Envelope "
|
||||||
|
|
Loading…
Reference in New Issue
Block a user