The Free Software Media System - Server Backend & API
update PathInfo parsing
Luke Pulverenti10383a90e652
diff --git a/MediaBrowser.Api/BaseApiService.cs b/MediaBrowser.Api/BaseApiService.csindex 3ff432d741..ce3e963b7b 100644--- a/MediaBrowser.Api/BaseApiService.cs+++ b/MediaBrowser.Api/BaseApiService.cs@@ -6,9 +6,9 @@ using MediaBrowser.Controller.Net;using MediaBrowser.Controller.Session;using MediaBrowser.Model.Entities;using MediaBrowser.Model.Logging;-using ServiceStack.Text.Controller;using ServiceStack.Web;using System;+using System.Collections.Generic;using System.Linq;using System.Threading.Tasks;@@ -275,8 +275,8 @@ namespace MediaBrowser.Apiprotected string GetPathValue(int index){- var pathInfo = PathInfo.Parse(Request.PathInfo);- var first = pathInfo.GetArgumentValue<string>(0);+ var pathInfo = Parse(Request.PathInfo);+ var first = pathInfo[0];// backwards compatibilityif (string.Equals(first, "mediabrowser", StringComparison.OrdinalIgnoreCase) ||@@ -285,7 +285,24 @@ namespace MediaBrowser.Apiindex++;}- return pathInfo.GetArgumentValue<string>(index);+ return pathInfo[index];+ }++ private static List<string> Parse(string pathUri)+ {+ var actionParts = pathUri.Split(new[] { "://" }, StringSplitOptions.None);++ var pathInfo = actionParts[actionParts.Length - 1];++ var optionsPos = pathInfo.LastIndexOf('?');+ if (optionsPos != -1)+ {+ pathInfo = pathInfo.Substring(0, optionsPos);+ }++ var args = pathInfo.Split('/');++ return args.Skip(1).ToList();}/// <summary>diff --git a/MediaBrowser.Api/MediaBrowser.Api.csproj b/MediaBrowser.Api/MediaBrowser.Api.csprojindex dafee4b8b6..fde40aeb6c 100644--- a/MediaBrowser.Api/MediaBrowser.Api.csproj+++ b/MediaBrowser.Api/MediaBrowser.Api.csproj@@ -61,9 +61,6 @@<Reference Include="ServiceStack.Interfaces"><HintPath>..\ThirdParty\ServiceStack\ServiceStack.Interfaces.dll</HintPath></Reference>- <Reference Include="ServiceStack.Text">- <HintPath>..\ThirdParty\ServiceStack.Text\ServiceStack.Text.dll</HintPath>- </Reference></ItemGroup><ItemGroup><Compile Include="..\SharedVersion.cs">