Skip to content

Commit

Permalink
Remove charset=utf-8 default
Browse files Browse the repository at this point in the history
  • Loading branch information
BigBlueHat committed Jun 19, 2018
1 parent 609f1c9 commit e8ac599
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/ecstatic.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ module.exports = function createMiddleware(_dir, _options) {
let stream = null;

if (contentType) {
charSet = mime.charsets.lookup(contentType, 'utf-8');
charSet = mime.charsets.lookup(contentType);
if (charSet) {
contentType += `; charset=${charSet}`;
}
Expand Down
2 changes: 1 addition & 1 deletion test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ test('setting mimeTypes via cli - directly', (t) => {
t.pass('ecstatic should be started');
checkServerIsRunning(`${defaultUrl}:${port}/custom_mime_type.opml`, t, (err, res) => {
t.error(err);
t.equal(res.headers['content-type'], 'application/x-my-type; charset=utf-8');
t.equal(res.headers['content-type'], 'application/x-my-type');
});
});
});
2 changes: 1 addition & 1 deletion test/custom-content-type-file-secret.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test('custom contentType via .types file', (t) => {
request.get(`http://localhost:${port}/custom_mime_type.opml`, (err, res) => {
t.ifError(err);
t.equal(res.statusCode, 200, 'custom_mime_type.opml should be found');
t.equal(res.headers['content-type'], 'application/secret; charset=utf-8');
t.equal(res.headers['content-type'], 'application/secret');
server.close(() => { t.end(); });
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/custom-content-type-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ test('custom contentType via .types file', (t) => {
request.get(`http://localhost:${port}/custom_mime_type.opml`, (err, res) => {
t.ifError(err);
t.equal(res.statusCode, 200, 'custom_mime_type.opml should be found');
t.equal(res.headers['content-type'], 'application/foo; charset=utf-8');
t.equal(res.headers['content-type'], 'application/foo');
server.close(() => { t.end(); });
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/custom-content-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test('custom contentType', (t) => {
request.get(`http://localhost:${port}/custom_mime_type.opml`, (err, res) => {
t.ifError(err);
t.equal(res.statusCode, 200, 'custom_mime_type.opml should be found');
t.equal(res.headers['content-type'], 'application/jon; charset=utf-8');
t.equal(res.headers['content-type'], 'application/jon');
server.close(() => { t.end(); });
});
});
Expand Down

0 comments on commit e8ac599

Please sign in to comment.