From 991f26e871921b0bf8745e28dfd53b9b98b6d06a Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Fri, 23 Oct 2020 15:18:37 +0530 Subject: [PATCH] Serve plain text if Accept header isn't set --- server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.js b/server.js index 1dc6520..4f01dc0 100644 --- a/server.js +++ b/server.js @@ -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 {