Skip to content

Commit

Permalink
Merge pull request #5189 from Wilhansen/rss-ssl-protocolfix
Browse files Browse the repository at this point in the history
Provide secure post and image links if RSS accessed over SSL
  • Loading branch information
ErisDS committed Apr 24, 2015
2 parents 62c60c8 + d02bcba commit 0623dd4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/server/data/xml/rss/index.js
Expand Up @@ -155,7 +155,7 @@ generateFeed = function (data) {
});

data.results.posts.forEach(function (post) {
var itemUrl = config.urlFor('post', {post: post, permalinks: data.permalinks}, true),
var itemUrl = config.urlFor('post', {post: post, permalinks: data.permalinks, secure: data.secure}, true),
htmlContent = processUrls(post.html, data.siteUrl, itemUrl),
item = {
title: post.title,
Expand All @@ -170,7 +170,7 @@ generateFeed = function (data) {
imageUrl;

if (post.image) {
imageUrl = config.urlFor('image', {image: post.image}, true);
imageUrl = config.urlFor('image', {image: post.image, secure: data.secure}, true);

// Add a media content tag
item.custom_elements.push({
Expand Down Expand Up @@ -224,6 +224,7 @@ generate = function (req, res, next) {
data.version = res.locals.safeVersion;
data.siteUrl = config.urlFor('home', {secure: req.secure}, true);
data.feedUrl = config.urlFor({relativeUrl: baseUrl, secure: req.secure}, true);
data.secure = req.secure;

return getFeedXml(req.route.path, data).then(function (feedXml) {
res.set('Content-Type', 'text/xml; charset=UTF-8');
Expand Down

0 comments on commit 0623dd4

Please sign in to comment.