Skip to content
Myr

res.render() using res.send()

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 6a10a67 · Browse files · 2 files+2 added−11 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+2 added−11 removed

  • tests:+1 added−1 removed
  • other:+1 added−10 removed

2 files+2 added−11 removed

modified:lib/express/view.js+1 added-10 removed
248 unmodified lines
249250 // View path251 var path = root + '/' + view;252253 // Send response254 function send(str) {255 self.writeHead(200, {256 'Content-Type': 'text/html',257 'Content-Length': str.length258 });259 self.end(str);260 }261253 // Pass filename to the engine and view254 options.locals = options.locals || {};255 options.locals.__filename = options.filename = path;256
49 unmodified lines
306 return str;307 } else if (fn) {308 fn(null, str);309 } else {319 send(str);310 self.send(str);311 }312};
modified:test/view.test.js+1 added-1 removed
37 unmodified lines
38 });3940 assert.response(app,41 { url: '/' },42 { body: '<p>Welcome</p>' });42 { body: '<p>Welcome</p>', headers: { 'Content-Type': 'text/html; charset=utf-8' }});43 assert.response(app,44 { url: '/jade' },45 { body: '<p>Welcome</p>' });46 assert.response(app,
237 unmodified lines