From e6edfbf9a0b57648a22f484fc1a2837517a8bb0e Mon Sep 17 00:00:00 2001 From: YaR Date: Fri, 9 Dec 2016 14:36:52 +0300 Subject: [PATCH] fixed work with items at root folder --- WebDavMailRuCloudStore/Mailru/StoreBase/MailruStore.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/WebDavMailRuCloudStore/Mailru/StoreBase/MailruStore.cs b/WebDavMailRuCloudStore/Mailru/StoreBase/MailruStore.cs index e516bae9..cbefc46a 100644 --- a/WebDavMailRuCloudStore/Mailru/StoreBase/MailruStore.cs +++ b/WebDavMailRuCloudStore/Mailru/StoreBase/MailruStore.cs @@ -55,7 +55,7 @@ private string GetPathFromUri(Uri uri) ////can't use uri.LocalPath and so on cause of special signs //var requestedPath = Regex.Replace(uri.AbsoluteUri, @"^http?://.*?/", string.Empty); - var requestedPath = Regex.Replace(uri.OriginalString, @"^http?://.*?/", string.Empty); + var requestedPath = Regex.Replace(uri.OriginalString, @"^http?://.*?(/|\Z)", string.Empty); requestedPath = "/" + requestedPath.TrimEnd('/'); if (string.IsNullOrWhiteSpace(requestedPath)) requestedPath = "/"; @@ -63,12 +63,6 @@ private string GetPathFromUri(Uri uri) requestedPath = Uri.UnescapeDataString(requestedPath); return requestedPath; - - //var requestedPath = uri.LocalPath; - //requestedPath = requestedPath.TrimEnd('/'); - //requestedPath = HttpUtility.UrlDecode(requestedPath); - //if (string.IsNullOrWhiteSpace(requestedPath)) requestedPath = "/"; - //return requestedPath; } } }