Skip to content
Myr

default res.send() string charset to utf8

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 d0d17a0 · Browse files · 3 files+3 added−2 removed
This commit

State

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

Diff stats

3 files+3 added−2 removed

  • tests:+2 added−2 removed
  • other:+1 added−0 removed

3 files+3 added−2 removed

modified:lib/response.js+1 added
61 unmodified lines
62 body = http.STATUS_CODES[status = body];63 break;64 case 'string':65 if (!this.header('Content-Type')) {66 this.charset = this.charset || 'utf8';67 this.contentType('.html');68 }69 break;70 case 'object':
305 unmodified lines
modified:test/response.test.js+1 added-1 removed
53 unmodified lines
54 { url: '/html' },55 { body: '<p>test</p>'56 , headers: {57 'Content-Language': 'en'58 , 'Content-Type': 'text/html'58 , 'Content-Type': 'text/html; charset=utf8'59 }});6061 assert.response(app,62 { url: '/json' },
517 unmodified lines
modified:test/view.test.js+1 added-1 removed
173 unmodified lines
174 { url: '/ferret' },175 { body: '<li class="ferret">Tobi</li>' });176 assert.response(app,177 { url: '/' },178 { body: '<p>Welcome</p>', headers: { 'Content-Type': 'text/html' }});178 { body: '<p>Welcome</p>', headers: { 'Content-Type': 'text/html; charset=utf8' }});179 assert.response(app,180 { url: '/jade' },181 { body: '<p>Welcome</p>' });182 assert.response(app,
756 unmodified lines