HTTPS iframe inside a HTTPS page not working

后端 未结 1 1341
终归单人心
终归单人心 2021-02-05 13:59

How can we use github pages embedded in an iframe correctly?

I\'ve hosted a website in firebase and it is using a custom domain over https, for example, https://

1条回答
  •  执笔经年
    2021-02-05 14:53

    If you carefully examine your HTML code and the error message, you'll notice a slight difference in URLs besides the protocol part:

    • https://example.github.io/page - in the iframe src tag
    • http://example.github.io/page/ - in the error message

    The reason could be that the URL https://example.github.io/page returns a redirect to the "canonical" version with the trailing slash (/page/), but a redirect URL must be a full URL, and the server for some reason isn't including the actual protocol in the redirect URL, always using http:// instead. That could be due to configuration or coding at the server side (see also github issue #289).

    As a workaround, use a URL that doesn't trigger the canonicalization redirect, i.e. https://example.github.io/page/.

    0 讨论(0)
提交回复
热议问题