Skip to content
Myr

Fixed; default charset to utf-8 instead of utf8 for lame IE [reported by NickP]

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 3cacf05 · Browse files · 3 files+4 added−4 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+4 added−4 removed

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

3 files+4 added−4 removed

modified:lib/response.js+1 added-1 removed
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';66 this.charset = this.charset || 'utf-8';67 this.contentType('.html');68 }69 break;70 case 'object':
315 unmodified lines
modified:test/response.test.js+2 added-2 removed
53 unmodified lines
54 { url: '/html' },55 { body: '<p>test</p>'56 , headers: {57 'Content-Language': 'en'58 , 'Content-Type': 'text/html; charset=utf8'58 , 'Content-Type': 'text/html; charset=utf-8'59 }});60 61 assert.response(app,62 { url: '/json' },
57 unmodified lines
120 { url: '/error' },121 { body: 'Oh shit!'122 , status: 500123 , headers: {124 'Content-Type': 'text/plain; charset=utf8'124 'Content-Type': 'text/plain; charset=utf-8'125 , 'Content-Length': '8'126 }});127 128 assert.response(app,
459 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; charset=utf8' }});178 { body: '<p>Welcome</p>', headers: { 'Content-Type': 'text/html; charset=utf-8' }});179 assert.response(app,180 { url: '/jade' },181 { body: '<p>Welcome</p>' });182 assert.response(app,
756 unmodified lines