diff options
| author | Leitwolf | 2026-10-15 18:44:01 +0300 |
|---|---|---|
| committer | GitHub | 2026-10-15 18:44:01 +0300 |
| commit | 3877e3318e875cdebc3d7b9bc970b4496e5183a9 (patch) | |
| tree | d6390125eb9045ab3496f6cee7544f26a183c4ba /apps/api/Program.cs | |
| parent | a7604e755e5bb77729a309daea75b14522d22afe (diff) | |
| parent | bd83e9e0fba03a4436e4fcfdde33c1e04d1a9c8f (diff) | |
| download | progmaweb-3877e3318e875cdebc3d7b9bc970b4496e5183a9.tar.gz | |
Merge pull request #37 from Progmasoft/fix/hsts-preload
Treat progmasoft.com as an HSTS-preloaded domain
Diffstat (limited to 'apps/api/Program.cs')
| -rw-r--r-- | apps/api/Program.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/api/Program.cs b/apps/api/Program.cs index fd6e97b..3eb96c9 100644 --- a/apps/api/Program.cs +++ b/apps/api/Program.cs @@ -47,6 +47,14 @@ if (!string.IsNullOrWhiteSpace(googleClientId) && !string.IsNullOrWhiteSpace(goo }); } builder.Services.AddProblemDetails(); +// progmasoft.com is served as if .com required HSTS: the API answers with the same preload header as Nginx, so a +// proxied response never carries two different policies. +builder.Services.AddHsts(options => +{ + options.MaxAge = TimeSpan.FromDays(730); + options.IncludeSubDomains = true; + options.Preload = true; +}); builder.Services.AddHealthChecks(); builder.Services.AddRateLimiter(options => { |