Serve plain text if Accept header isn't set

This commit is contained in:
Ceda EI 2020-10-23 15:18:37 +05:30
parent e2293900de
commit 991f26e871
1 changed files with 1 additions and 1 deletions

View File

@ -142,7 +142,7 @@ app.use(connect_st({
// so route it back to /
app.use(route(function(router) {
router.get('/:id', function(request, response, next) {
if (request.headers.accept.includes('html')) {
if (request.headers.accept && request.headers.accept.includes('html')) {
request.sturl = '/';
next();
} else {