Skip to content

Commit

Permalink
RSS: Don't add trailing '/' to post image
Browse files Browse the repository at this point in the history
Closes TryGhost#4888

We automatically added a trailing slash to all non-absolute paths in
RSS, including post images. This fix ensures that trailing slashes
aren’t added to absolute paths including ‘content/images/‘.
  • Loading branch information
felixrieseberg committed Mar 2, 2015
1 parent 60f1205 commit 436d2a8
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions core/server/controllers/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,20 +561,6 @@ frontendControllers = {
attributeValue = attributeValue.substr(1);
}

// make sure URL has a trailing slash
try {
parsed = url.parse(attributeValue);

if (parsed.pathname && parsed.pathname.slice(-1) !== '/') {
parsed.pathname += '/';

attributeValue = url.format(parsed);
}
} catch (e) {
// if the URL we've built cannot be parsed, fall back to the unprocessed URL
return;
}

attributeValue = baseUrl + attributeValue;
el.attr(attributeName, attributeValue);
});
Expand Down

0 comments on commit 436d2a8

Please sign in to comment.