-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from Lombiq/issue/SITE-63-OSOE
SITE-63: Adjusting UI test extensions
- Loading branch information
Showing
3 changed files
with
33 additions
and
15 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
Lombiq.Hosting.MediaTheme.Bridge/Helpers/RequestUrlPrefixRemover.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using OrchardCore.Environment.Shell; | ||
using System; | ||
|
||
namespace Lombiq.Hosting.MediaTheme.Bridge.Helpers; | ||
|
||
internal static class RequestUrlPrefixRemover | ||
{ | ||
public static string RemoveIfHasPrefix(string path, ShellSettings shellSettings) | ||
{ | ||
var requestUrlPrefix = shellSettings.RequestUrlPrefix; | ||
if (string.IsNullOrEmpty(requestUrlPrefix) || | ||
!path.StartsWith("/" + requestUrlPrefix, StringComparison.OrdinalIgnoreCase)) | ||
{ | ||
return path; | ||
} | ||
|
||
return path[(requestUrlPrefix.Length + 1)..]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters