Fix trailing-slash-agnostic redirect

This commit is contained in:
Daniel J. Summers 2022-06-01 07:50:46 -04:00
parent c377496611
commit 2a796042ac
2 changed files with 3 additions and 2 deletions

View File

@ -54,7 +54,8 @@ module CatchAll =
yield Feed.generate feedType postCount yield Feed.generate feedType postCount
| None -> () | None -> ()
// Post differing only by trailing slash // Post differing only by trailing slash
let altLink = Permalink (if textLink.EndsWith "/" then textLink[..textLink.Length - 2] else $"{textLink}/") let altLink =
Permalink (if textLink.EndsWith "/" then textLink[1..textLink.Length - 2] else $"{textLink[1..]}/")
match Data.Post.findByPermalink altLink webLog.id conn |> await with match Data.Post.findByPermalink altLink webLog.id conn |> await with
| Some post -> | Some post ->
debug (fun () -> $"Found post by trailing-slash-agnostic permalink") debug (fun () -> $"Found post by trailing-slash-agnostic permalink")

View File

@ -3,7 +3,7 @@
"hostname": "data02.bitbadger.solutions", "hostname": "data02.bitbadger.solutions",
"database": "myWebLog_dev" "database": "myWebLog_dev"
}, },
"Generator": "myWebLog 2.0-alpha24", "Generator": "myWebLog 2.0-alpha25",
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {
"MyWebLog.Handlers": "Debug" "MyWebLog.Handlers": "Debug"