mirror of
https://github.com/jellyfin/jellyfin-plugin-dlna.git
synced 2024-11-26 16:00:55 +00:00
Only split user agent if it can be split (#95)
This commit is contained in:
parent
edcdf04acd
commit
36d957c4e8
@ -66,7 +66,12 @@ public class DlnaServerController : ControllerBase
|
||||
string? userAgent = Request.Headers.UserAgent;
|
||||
if (userAgent is not null)
|
||||
{
|
||||
userAgent = userAgent.Substring(0, userAgent.IndexOf('/'));
|
||||
var firstIndexOfSlash = userAgent.IndexOf('/');
|
||||
if (firstIndexOfSlash > 0)
|
||||
{
|
||||
userAgent = userAgent.Substring(0, firstIndexOfSlash);
|
||||
}
|
||||
|
||||
useRelativePath = _relativePathUserAgents.Contains(userAgent, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user