Skip to content
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

Merged
merged 2 commits into from
Feb 20, 2016
Merged

Use HTTPS for Disqus requests #372

merged 2 commits into from
Feb 20, 2016

Conversation

adamatan
Copy link
Contributor

The problem

Disqus does not load from https:// sites under the gum theme (and almost any other). This happens because the Disqus URL prefix is http://, 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:

s.src = '//XXXXX.disqus.com/embed.js';

While themes use:

s.src = 'http://XXXXX.disqus.com/embed.js';
s.src = 'https://XXXXX.disqus.com/embed.js';

Where XXXXX is the Disqus site name, denoted {{ DISQUS_SITENAME }} in Pelican.

My solution

I've converted both http:// and https:// 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

@justinmayer
Copy link
Member

justinmayer commented Feb 19, 2016 via email

@adamatan
Copy link
Contributor Author

@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.
The only other viable option is forcing https, but I'm not sure it's better than a Protocol-relative URL in this case.

@justinmayer
Copy link
Member

justinmayer commented Feb 19, 2016 via email

@justinmayer
Copy link
Member

justinmayer commented Feb 19, 2016 via email

@justinmayer
Copy link
Member

justinmayer commented Feb 19, 2016 via email

@adamatan
Copy link
Contributor Author

Sure, I read that one.

So, should I make another PR with https everywhere?

@justinmayer
Copy link
Member

justinmayer commented Feb 19, 2016 via email

@adamatan
Copy link
Contributor Author

Done.

@adamatan adamatan changed the title Use Protocol-relative URL for Disqus Use HTTPs for Disqus Feb 20, 2016
@justinmayer
Copy link
Member

Excellent. Many thanks, Adam!

@justinmayer justinmayer changed the title Use HTTPs for Disqus Use HTTPS for Disqus requests Feb 20, 2016
justinmayer added a commit that referenced this pull request Feb 20, 2016
Use HTTPS for Disqus requests
@justinmayer justinmayer merged commit e57f033 into getpelican:master Feb 20, 2016
@adamatan
Copy link
Contributor Author

@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.

masayukig added a commit to masayukig/pelican-themes that referenced this pull request Mar 6, 2016
This reverts commit 60114c8.
That was an intended change by getpelican#372 .
getpelican#372
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants