From a025f4eefaf43c27f33521239d99c47d292728f5 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 31 Mar 2015 12:24:16 -0400 Subject: sync updates --- MediaBrowser.Api/BaseApiService.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'MediaBrowser.Api/BaseApiService.cs') diff --git a/MediaBrowser.Api/BaseApiService.cs b/MediaBrowser.Api/BaseApiService.cs index 4465be97a..3364c3c6b 100644 --- a/MediaBrowser.Api/BaseApiService.cs +++ b/MediaBrowser.Api/BaseApiService.cs @@ -73,6 +73,17 @@ namespace MediaBrowser.Api return ResultFactory.GetOptimizedResultUsingCache(Request, cacheKey, lastDateModified, cacheDuration, factoryFn); } + /// + /// Infers the server address from the url + /// + /// + protected string GetServerAddress() + { + var index = Request.AbsoluteUri.IndexOf(Request.PathInfo, StringComparison.OrdinalIgnoreCase); + + return Request.AbsoluteUri.Substring(0, index); + } + protected void AssertCanUpdateUser(IUserManager userManager, string userId) { var auth = AuthorizationContext.GetAuthorizationInfo(Request); -- cgit v1.2.3