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

https image urls if accessed over SSL #8373

Merged
merged 4 commits into from
May 15, 2017
Merged

https image urls if accessed over SSL #8373

merged 4 commits into from
May 15, 2017

Conversation

sovietspaceship2
Copy link

Tentative fix for #8372. I'm not familiar with this codebase so I don't know the rationale behind the current code nor whether this change would be enough, but hopefully will point to the right direction.

Copy link
Contributor

@kirrg001 kirrg001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR!

Could you please add a test case to proof your case is not working?

Probably in core/test/unit/utils/url_spec.js.

@kirrg001 kirrg001 self-assigned this Apr 24, 2017
tests whether utils.url.urlFor returns https urls for images over https when blog is configured with a http baseUrl
fixes #8372
@sovietspaceship2
Copy link
Author

Our blog had optional https but http by default, so it was configured with an http base url. The https version of the rss feed was returning http links for images as the current code only checks the image path for https, ignoring that the actual connection may be https. This PR fixes it.

@@ -259,7 +259,7 @@ function urlFor(context, data, absolute) {
urlPath = data.image;
imagePathRe = new RegExp('^' + getSubdir() + '/' + STATIC_IMAGE_URL_PREFIX);
absolute = imagePathRe.test(data.image) ? absolute : false;
secure = data.image.secure;
secure = data.image.secure || secure;

This comment was marked as abuse.

This comment was marked as abuse.

Copy link
Contributor

@kirrg001 kirrg001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thank you!

@kirrg001 kirrg001 merged commit e066094 into TryGhost:master May 15, 2017
kirrg001 pushed a commit to kirrg001/Ghost that referenced this pull request May 15, 2017
closes TryGhost#8372

- https image urls if accessed over SSL (fix secure option for images)
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