前言
在網站上,雖然用 https ,但有些 image 還是使用 http 去 link ,這會產生 Mixed Content 的問題,如下,

實作
web.config
1 |
|
_Layout.cshtml
1 |
|
Startup.cs
1 | app.Use(async (context, next) => |
當這樣設定後,會把原本是用 http 的link 改成 https 了哦!
參考資料
How to handle mixed content with CSP
ASP.NET Security Headers