Default charset not set when calling res.render from within res.format #1585

allenpc opened this Issue Apr 19, 2013 · 2 comments


None yet
3 participants

allenpc commented Apr 19, 2013

Normally, res.render() will have a default charset of utf-8 because it eventually calls through res.send(), which has logic for default Content-Type and charset when the content is a string.

However, if you call res.render() from within the html callback of a res.format() call, the default charset is not set because res.format() sets the Content-Type, which doesn't allow the default charset logic in res.send() to kick in later.

I thought about adding some logic in res.render() to set a default charset, but I realized that this probably isn't the right thing to do since you can pass a callback and potentially send back something that isn't text/html.


sorribas commented Sep 9, 2013

I think this was solved with #1747 wasn't it @visionmedia @jonathanong?


jonathanong commented Sep 9, 2013

Thanks @sorribas. There are a bunch of charset issues, I just haven't looked into the current state.

@jonathanong jonathanong closed this Sep 9, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment