File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,9 @@ module.exports = function wrapper(context) {
72
72
73
73
let contentType = mime . getType ( filename ) ;
74
74
const mimeInfo = mimeDb [ contentType ] ;
75
- const charset = mimeInfo && mimeInfo . charset ;
75
+ const charset = ( mimeInfo && mimeInfo . charset )
76
+ // Special-cased to prevent possible breaking change
77
+ || ( contentType === 'text/html' && 'UTF-8' ) ;
76
78
77
79
if ( charset ) {
78
80
contentType += `; charset=${ charset } ` ;
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ describe('Server', () => {
96
96
97
97
it ( 'request to directory' , ( done ) => {
98
98
request ( app ) . get ( '/public/' )
99
- . expect ( 'Content-Type' , 'text/html' )
99
+ . expect ( 'Content-Type' , 'text/html; charset=UTF-8 ' )
100
100
. expect ( 'Content-Length' , '10' )
101
101
. expect ( 200 , / M y I n d e x \. / , done ) ;
102
102
} ) ;
@@ -167,7 +167,6 @@ describe('Server', () => {
167
167
168
168
it ( 'request to directory' , ( done ) => {
169
169
request ( app ) . get ( '/' )
170
- . expect ( 'Content-Type' , 'text/html; charset=utf-8' )
171
170
. expect ( 404 , done ) ;
172
171
} ) ;
173
172
} ) ;
@@ -240,7 +239,7 @@ describe('Server', () => {
240
239
it ( 'request to Index.phtml' , ( done ) => {
241
240
request ( app ) . get ( '/' )
242
241
. expect ( 'welcome' )
243
- . expect ( 'Content-Type' , / t e x t \ /h t m l / )
242
+ . expect ( 'Content-Type' , ' text/html; charset=UTF-8' )
244
243
. expect ( 200 , done ) ;
245
244
} ) ;
246
245
You can’t perform that action at this time.
0 commit comments