Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix RSS feed (fixes #33) #44

Closed
wants to merge 1 commit into from

2 participants

@fmarier

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.

@fmarier fmarier 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.
cb72aab
@DTrejo
Collaborator

Going to take your word for it that this change fixes things, as I don't use the RSS feed.

Thank you & cheers!
D

@DTrejo DTrejo closed this pull request from a commit
@fmarier fmarier 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>
6f1726b
@DTrejo DTrejo closed this in 6f1726b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 26, 2012
  1. @fmarier

    Fix RSS feed (fixes #33)

    fmarier authored
    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.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 2 deletions.
  1. +1 −1  lib/post.js
  2. +2 −1  server.js
View
2  lib/post.js
@@ -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
3  server.js
@@ -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())
})
Something went wrong with that request. Please try again.