Skip to content

Commit 19d0413

Browse files
authored
Set content-type header to text/plain to correct browser rendering.
1 parent c34e15f commit 19d0413

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ function errorHandler(error, res) {
1515

1616
app.use(morgan(':remote-addr :remote-user :method :url :status :res[content-length] - :response-time ms'));
1717

18+
app.use((req, res, next) => {
19+
res.setHeader('Content-Type', 'text/plain');
20+
next();
21+
});
22+
1823
app.get('/', (req, res) => {
1924
const format = req.query.format ? req.query.format : '';
2025

@@ -83,4 +88,4 @@ app.get('/:country', (req, res) => {
8388
});
8489

8590

86-
app.listen(port, () => console.log(`Running on ${port}`));
91+
app.listen(port, () => console.log(`Running on ${port}`));

0 commit comments

Comments
 (0)