Skip to content

Commit

Permalink
enforce hsts on every server
Browse files Browse the repository at this point in the history
  • Loading branch information
EdiWang committed Oct 10, 2023
1 parent f699140 commit 35cfa53
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
1 change: 1 addition & 0 deletions src/Moonglade.Web/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ void ConfigureMiddleware()
else
{
app.UseStatusCodePages(ConfigureStatusCodePages.Handler).UseExceptionHandler("/error");
app.UseHsts();
}

app.UseHttpsRedirection();
Expand Down
10 changes: 0 additions & 10 deletions src/Moonglade.Web/web.Release.config
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@
<action type="Redirect" url="{R:1}"/>
</rule>
</rules>
<outboundRules>
<rule name="Add Strict-Transport-Security when HTTPS" enabled="true">
<match serverVariable="RESPONSE_Strict_Transport_Security"
pattern=".*" />
<conditions>
<add input="{HTTPS}" pattern="on" ignoreCase="true" />
</conditions>
<action type="Rewrite" value="max-age=31536000;includeSubDomains;preload" />
</rule>
</outboundRules>
</rewrite>
</system.webServer>
</location>
Expand Down

0 comments on commit 35cfa53

Please sign in to comment.