ncase / simulating

An interactive guide to thinking in systems!
http://ncase.me/simulating
186 stars 21 forks source link

GitHub redirects iFrames to http #9

Closed j-maas closed 6 years ago

j-maas commented 6 years ago

After you've merged #8, I wanted to check out the site. Unfortunately, I still get errors about mixed content.

However, the URLs in the iframes' src is correctly set to https. Instead, I discovered that GitHub redirects to the http version.

Unfortunately, a quick search for this issue only yielded an issue recommending adding trailing slashes. This didn't work in a quick test I did where I inserted an iFrame with a modified URL in the browser's HTML.

Repro

In Firefox's network tab (same thing happens in Chrome), I can see requests with status 304. E. g. the one to https://ncase.me/simulating/model?local=zoo/sick&edit=1.

Request headers:

Host: ncase.me
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate, br
Referer: https://ncase.me/simulating/
Connection: keep-alive
Upgrade-Insecure-Requests: 1

Response headers:

HTTP/2.0 301 Moved Permanently
server: GitHub.com
content-type: text/html
location: http://ncase.me/simulating/model/?local=zoo/sick&edit=1
access-control-allow-origin: *
expires: Wed, 01 Aug 2018 09:58:05 GMT
cache-control: max-age=600
x-github-request-id: BDD8:79BD:1C33660:26EE5EE:5B6181D5
accept-ranges: bytes
date: Wed, 01 Aug 2018 09:48:05 GMT
via: 1.1 varnish
age: 0
x-served-by: cache-hhn1531-HHN
x-cache: MISS
x-cache-hits: 0
x-timer: S1533116886.768692,VS0,VE97
vary: Accept-Encoding
x-fastly-request-id: 143e6a617da1126baaaa8f3990da778f567380d2
content-length: 178
X-Firefox-Spdy: h2

Curiously, I can access that exact URL, https://ncase.me/simulating/model?local=zoo/sick&edit=1, just fine directly with the browser.

ncase commented 6 years ago

After trying a bunch of different things, I finally gave up and reverted this page back to HTTP. I have no idea why GitHub keeps redirecting to http. It works now, at least: http://ncase.me/simulating/

Thanks again for digging deeper into this issue, @Y0hy0h!