这是否通过 https 请求内容?

发布于 2024-11-17 03:19:00 字数 148 浏览 6 评论 0原文

如果我通过 https://mypage.com 访问页面 如果我通过 加载脚本标记;

上面的脚本是通过http还是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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

硪扪都還晓 2024-11-24 03:19:00

URI RFC 指定了这一点。以/ 开头的相对引用是相对于scheme://host 基数的。因此,相对引用相当于 https://mypage.com/js/myscript.js

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.

ゝ偶尔ゞ 2024-11-24 03:19:00

是的,这将通过 HTTPS 请求。

Yes, that will be requested via HTTPS.

故事灯 2024-11-24 03:19:00

是的,因为 SSL 证书应用于您请求 javascript 的页面。当您连接到 HTTPS 时,这意味着您打开了一个新端口,因此在请求该 .js 文件时您不再处于 HTTP 状态。然后它将通过HTTPS加载

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文