Hailwood
Hailwood

Reputation: 92581

does this request content via https?

If I am accessing a page via https://mypage.com if I load a script tag via <script src="/js/myscript.js"></script>

Is the above script called via http or https?

Upvotes: 3

Views: 62

Answers (3)

Benny Tjia
Benny Tjia

Reputation: 4883

yes since the SSL certificate is applied to the page in which you request the javascript. When you connect to HTTPS it means you open a new port, so you are no longer in HTTP at the point you request that .js file. Then it will be loaded via HTTPS

Upvotes: 2

Nemo
Nemo

Reputation: 71515

The URI RFC specifies this. Relative references starting with / are relative to the scheme://host base. So that relative reference is equivalent to https://mypage.com/js/myscript.js.

Upvotes: 3

ceejayoz
ceejayoz

Reputation: 179994

Yes, that will be requested via HTTPS.

Upvotes: 3

Related Questions