DirectorySeparator issue when black or forward slash.

Tested on Apple mac and Windows
This commit is contained in:
Leigh Pointer
2021-02-11 15:38:37 +01:00
parent 22830a2cc1
commit c6e2c2e501
4 changed files with 17 additions and 12 deletions

View File

@ -1,4 +1,4 @@
using Oqtane.Models;
using Oqtane.Models;
using System.Threading.Tasks;
using System.Linq;
using System.Net.Http;
@ -37,11 +37,11 @@ namespace Oqtane.Services
{
if (!(folderPath.EndsWith(System.IO.Path.DirectorySeparatorChar) || folderPath.EndsWith(System.IO.Path.AltDirectorySeparatorChar)))
{
folderPath = Utilities.PathCombine(folderPath, "\\");
folderPath = Utilities.PathCombine(folderPath, System.IO.Path.DirectorySeparatorChar.ToString());
}
var path = WebUtility.UrlEncode(folderPath);
return await GetJsonAsync<Folder>($"{ApiUrl}/{siteId}/{path}");
}