diff --git a/src/MyWebLog/Program.fs b/src/MyWebLog/Program.fs index 59fbfa6..aa67d9a 100644 --- a/src/MyWebLog/Program.fs +++ b/src/MyWebLog/Program.fs @@ -26,6 +26,8 @@ type WebLogMiddleware(next: RequestDelegate, log: ILogger) = } +open Giraffe.Htmx + /// Middleware to check redirects for the current web log type RedirectRuleMiddleware(next: RequestDelegate, _log: ILogger) = @@ -44,6 +46,8 @@ type RedirectRuleMiddleware(next: RequestDelegate, _log: ILogger if regExFrom.IsMatch path then Some (regExFrom.Replace(path, patternTo)) else None) match matched with + | Some url when url.StartsWith "http" && ctx.Request.IsHtmx -> + do! ctx.Response.WriteAsync $"""""" | Some url -> ctx.Response.Redirect(url, permanent = true) | None -> return! next.Invoke ctx }