mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-03 17:36:59 +01:00
Fix RootPath was not working correctly on Linux
This commit is contained in:
parent
603263549b
commit
7e67ca1413
1 changed files with 3 additions and 1 deletions
|
@ -217,8 +217,10 @@ namespace BTCPayServer
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string GetRelativePathOrAbsolute(this HttpRequest request, string path)
|
public static string GetRelativePathOrAbsolute(this HttpRequest request, string path)
|
||||||
{
|
{
|
||||||
if (Uri.TryCreate(path, UriKind.Absolute, out var unused))
|
if (!Uri.TryCreate(path, UriKind.RelativeOrAbsolute, out var uri) ||
|
||||||
|
uri.IsAbsoluteUri)
|
||||||
return path;
|
return path;
|
||||||
|
|
||||||
if (path.Length > 0 && path[0] != '/')
|
if (path.Length > 0 && path[0] != '/')
|
||||||
path = $"/{path}";
|
path = $"/{path}";
|
||||||
return string.Concat(
|
return string.Concat(
|
||||||
|
|
Loading…
Add table
Reference in a new issue