Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why does heroku block http and not https

Tags:

http

https

heroku

I am currently using the free version of Heroku, when deploying an app, Heroku blocked http, I changed to https which was not blocked, why does this occur? <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"></script>

like image 700
stvD700 Avatar asked May 12 '26 18:05

stvD700


1 Answers

Heroku uses HTTPS by default which means your apps URL is given as https://myappname.herokuapp.com and when you as a user of the Internet request a web address using HTTPS what you are saying is 'I want an encrypted connection'.

Your browser therefore blocks, or at the very least warns you, when a website attempts to download non encrypted HTTP resources.

To avoid this all external linked resources in your code should use the HTTPS protocol. You can actually use a handy trick to do this by not specifying a protocol at all but instead using // so your script tag will look like this:

<script type="text/javascript" src="//code.jquery.com/jquery-2.1.4.min.js"></script>

Then it will use what ever protocol the browser uses for your website. Be is HTTP or HTTPS.

like image 86
DavidT Avatar answered May 15 '26 16:05

DavidT



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!