Skip to content
Myr

Added charset option for render()

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 54415bf · Browse files · 2 files+15 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+15 added−0 removed

  • tests:+12 added−0 removed
  • other:+3 added−0 removed

2 files+15 added−0 removed

modified:lib/view.js+3 added
219 unmodified lines
220221 // "view engine" setting222 options.defaultEngine = app.set('view engine');223224 // charset option225 if (options.charset) this.charset = options.charset;226227 // Populate view228 var orig = view = new View(view, options);229230 // Try _ prefix ex: ./views/_user.jade
93 unmodified lines
modified:test/view.test.js+12 added
894 unmodified lines
895896 assert.response(app,897 { url: '/' },898 { headers: { 'Content-Type': 'text/html; charset=utf8' }});899 },900 901 'test charset option': function(){902 var app = create();903904 app.get('/', function(req, res){905 res.render('hello.jade', { charset: 'utf8' });906 });907908 assert.response(app,909 { url: '/' },910 { headers: { 'Content-Type': 'text/html; charset=utf8' }});911 }912};