We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf5dec5 commit 360598eCopy full SHA for 360598e
LinkRouter/App/Services/RedirectionService.cs
@@ -22,12 +22,8 @@ public async Task<ActionResult> GetRedirect(string path)
22
{
23
var url = Config.RootRoute;
24
25
- if (Config.ErrorCodePattern.IsMatch(url))
26
- {
27
- var errorCodeMatch = Config.ErrorCodePattern.Match(url);
28
- var errorCode = int.Parse(errorCodeMatch.Groups[1].Value);
29
- return new StatusCodeResult(errorCode);
30
- }
+ if (TryGetErrorCode(url, out var notFoundStatusCode))
+ return new StatusCodeResult(notFoundStatusCode);
31
32
await MetricsService.IncrementFound("/");
33
0 commit comments