-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use HTTPS for Disqus requests #372
Conversation
…/universalcode/ - '//' instead of 'http://' or 'https://'
Protocol-relative URLs are an anti-pattern. Do some searching around and you will see links that explain why.
|
@justinmayer Thanks for the comment. Will do some reading. However, that's the official Disqus recommendation, and leaving the current http prefix is clearly wrong. |
As I mentioned before, using https everywhere, regardless of how the site itself is served.
|
I should add that I believe their official recommendation is just plain wrong. Why not call a resource via HTTPS if it's available via HTTPS?
|
See note at top: http://www.paulirish.com/2010/the-protocol-relative-url/
|
Sure, I read that one. So, should I make another PR with https everywhere? |
I suggest using this existing PR, squashing your commits once you're done.
|
Done. |
Excellent. Many thanks, Adam! |
Use HTTPS for Disqus requests
@justinmayer Sure thing - thanks for accepting. While on the same page, what's your opinion about #373? If built correctly, it can ease not only Disqus, but also for other boilerplate code like Google Analytics. |
This reverts commit 60114c8. That was an intended change by getpelican#372 . getpelican#372
The problem
Disqus does not load from
https://
sites under thegum
theme (and almost any other). This happens because the Disqus URL prefix ishttp://
, and insecure content will not be loaded from a secure site.The solution
Disqus documentation
According to the official Disqus documentation, the embed code source should use Protocol-relative URL:
While themes use:
Where
XXXXX
is the Disqus site name, denoted{{ DISQUS_SITENAME }}
in Pelican.My solution
I've converted both
http://
andhttps://
prefixes to the https, which will only work. Following comments on this thread, I decided to avoid Protocol-Relative URLs and just go secure in every call.See further discussion here: getpelican/pelican#1911