Asp.net MVC resolve Http/Https

試著忘記壹切 提交于 2021-02-05 08:26:08

问题


"Mixed Content: The page at 'https://mywebsite/user/signin?ReturnUrl=%2f' was loaded over HTTPS, but requested an insecure stylesheet 'http://fonts.googleapis.com/css?family=Raleway:300,200,100'. This request has been blocked; the content must be served over HTTPS."

In my head tag I have these links,

<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,400italic,700,800' rel='stylesheet' type='text/css'>

<link href='http://fonts.googleapis.com/css?family=Raleway:100' rel='stylesheet' type='text/css'>

Rather than making them https, is there a solution to determine http or https and dynamically change these links?, sounds like a very simple question.


回答1:


Well, surprisingly the answer found to be a pretty simple one, just remove http

<link href='//fonts.googleapis.com/css?family=Open+Sans:400,300,600,400italic,700,800' rel='stylesheet' type='text/css'>

<link href='//fonts.googleapis.com/css?family=Raleway:100' rel='stylesheet' type='text/css'>


来源:https://stackoverflow.com/questions/30392819/asp-net-mvc-resolve-http-https

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!