Permalink
Browse files

Fix RSS feed (fixes #33)

The header-setting code needs to change to work with newer versions
of Express.

I'm not sure why the creation date in the article-processing code
ever worked because "new Date()" returns an object, not a string.

Close #44.

Signed-off-by: DTrejo <david.daniel.trejo@gmail.com>
  • Loading branch information...
1 parent 5ffbfbe commit 6f1726bbe0b992e7d4b8f210bf62d76a024d4561 @fmarier fmarier committed with DTrejo Nov 26, 2012
Showing with 3 additions and 2 deletions.
  1. +1 −1 lib/post.js
  2. +2 −1 server.js
View
@@ -54,7 +54,7 @@ Post.rss = function () {
s += '<description>' + htmlesc(posts[i].html()) + '</description>';
s += '<link>' + htmlesc(domain + posts[i].url()) + '</link>';
s += '<guid>' + htmlesc(domain + posts[i].url()) + '</guid>';
- s += '<pubDate>' + htmlesc(posts[i].created()) + '</pubDate>';
+ s += '<pubDate>' + htmlesc(posts[i].created().toUTCString()) + '</pubDate>';
s += '</item>';
}
s += '</channel></rss>';
View
@@ -28,7 +28,8 @@ app.get("/:y/:m/:d/:title", function(req, res) {
// GET "/rss"
app.get("/rss", function(req, res) {
- res.headers['Content-Type'] = 'text/xml; charset=utf-8'
+ res.type('text/xml')
+ res.charset = 'utf-8'
res.send(Post.rss())
})

0 comments on commit 6f1726b

Please sign in to comment.