Download HTTPS objects over HTTP

I try to download Google Fonts and the image via HTTPS, but they continue to download via HTTP, despite changing the path to "https" in all assets.

Mixed content: the page with 'https: //' was loaded via HTTPS, but requested an insecure stylesheet http://fonts.googleapis.com/css?family=Robotoready00,100,100italic,300italic,300,400italic,500,500italic,700,700italic , 900,900italic '. This request is blocked; content must be transmitted via HTTPS.

Mixed content: the page with 'https: //' was loaded via HTTPS, but requested an insecure image ' http://farm6.staticflickr.com/5267/5783999789_9d06e5d7df_b.jpg '. This content must also be transmitted via HTTPS.

+1
source share
2 answers

You can use the protocol-related URL as follows:

'//fonts.googleapis.com/css?family=Roboto:400,100,100italic,300italic,300,400italic,500,500italic,700,700italic,900,900italic'. 

Also, don't forget to run

  rake assets:precompile 

before clicking on the hero.

+2
source

For people who encounter similar problems, using laravel {{HTML::style('css/style.css')}} and {{HTML::script('js/script.js')}} , you can simply do HTMLBuilder safe by changing instructions to

{{HTML::style('css/style.css',array(),true)}} and

{{HTML::script('js/script.js',array(),true)}}

where 'true' insists content is disabled or https

+1
source

Source: https://habr.com/ru/post/1213765/


All Articles