Fixed baseurl in dlna.

This commit is contained in:
Greenback 2020-11-21 19:50:40 +00:00
parent 9b5ae690c1
commit 5224200e8c
2 changed files with 2 additions and 18 deletions

View File

@ -40,8 +40,6 @@ namespace Emby.Dlna.Server
_serverId = serverId; _serverId = serverId;
} }
private static bool EnableAbsoluteUrls => false;
public string GetXml() public string GetXml()
{ {
var builder = new StringBuilder(); var builder = new StringBuilder();
@ -75,13 +73,6 @@ namespace Emby.Dlna.Server
builder.Append("<minor>0</minor>"); builder.Append("<minor>0</minor>");
builder.Append("</specVersion>"); builder.Append("</specVersion>");
if (!EnableAbsoluteUrls)
{
builder.Append("<URLBase>")
.Append(SecurityElement.Escape(_serverAddress))
.Append("</URLBase>");
}
AppendDeviceInfo(builder); AppendDeviceInfo(builder);
builder.Append("</root>"); builder.Append("</root>");
@ -257,14 +248,7 @@ namespace Emby.Dlna.Server
return string.Empty; return string.Empty;
} }
url = url.TrimStart('/'); url = _serverAddress.TrimEnd('/') + "/dlna/" + _serverUdn + "/" + url.TrimStart('/');
url = "/dlna/" + _serverUdn + "/" + url;
if (EnableAbsoluteUrls)
{
url = _serverAddress.TrimEnd('/') + url;
}
return SecurityElement.Escape(url); return SecurityElement.Escape(url);
} }

View File

@ -252,7 +252,7 @@ namespace Jellyfin.Api.Controllers
private string GetAbsoluteUri() private string GetAbsoluteUri()
{ {
return $"{Request.Scheme}://{Request.Host}{Request.Path}"; return $"{Request.Scheme}://{Request.Host}{Request.PathBase}{Request.Path}";
} }
private Task<ControlResponse> ProcessControlRequestInternalAsync(string id, Stream requestStream, IUpnpService service) private Task<ControlResponse> ProcessControlRequestInternalAsync(string id, Stream requestStream, IUpnpService service)