diff --git a/.gitignore b/.gitignore index 170e429..4a0e7bf 100644 --- a/.gitignore +++ b/.gitignore @@ -261,6 +261,7 @@ src/MyWebLog/wwwroot/img/daniel-j-summers src/MyWebLog/wwwroot/img/bit-badger .ionide +.vscode src/MyWebLog/appsettings.Production.json # SQLite database files diff --git a/src/MyWebLog.Data/MyWebLog.Data.fsproj b/src/MyWebLog.Data/MyWebLog.Data.fsproj index 1f1cf76..6a6ae75 100644 --- a/src/MyWebLog.Data/MyWebLog.Data.fsproj +++ b/src/MyWebLog.Data/MyWebLog.Data.fsproj @@ -5,18 +5,22 @@ - - + + - + - + + + + + diff --git a/src/MyWebLog.Domain/MyWebLog.Domain.fsproj b/src/MyWebLog.Domain/MyWebLog.Domain.fsproj index 9511caa..048dc6c 100644 --- a/src/MyWebLog.Domain/MyWebLog.Domain.fsproj +++ b/src/MyWebLog.Domain/MyWebLog.Domain.fsproj @@ -7,9 +7,9 @@ - - - + + + diff --git a/src/MyWebLog/MyWebLog.fsproj b/src/MyWebLog/MyWebLog.fsproj index 78ad373..037c8b9 100644 --- a/src/MyWebLog/MyWebLog.fsproj +++ b/src/MyWebLog/MyWebLog.fsproj @@ -23,13 +23,15 @@ - - - - - + + + + + + + diff --git a/src/MyWebLog/Program.fs b/src/MyWebLog/Program.fs index f114259..1437985 100644 --- a/src/MyWebLog/Program.fs +++ b/src/MyWebLog/Program.fs @@ -99,6 +99,8 @@ let showHelp () = open System.IO +open System.Linq +open BitBadger.AspNetCore.CanonicalDomains open Giraffe open Giraffe.EndpointRouting open Microsoft.AspNetCore.Authentication.Cookies @@ -200,6 +202,10 @@ let rec main args = do! Maintenance.loadTheme [| ""; themeFile |] app.Services let _ = app.UseForwardedHeaders () + + let domainCfg = app.Services.GetRequiredService().GetSection "CanonicalDomains" + if domainCfg.AsEnumerable().Count () > 0 then app.UseCanonicalDomains () |> ignore + let _ = app.UseCookiePolicy (CookiePolicyOptions (MinimumSameSitePolicy = SameSiteMode.Strict)) let _ = app.UseMiddleware () let _ = app.UseAuthentication ()