Serve plain text if Accept header isn't set
This commit is contained in:
parent
e2293900de
commit
991f26e871
|
@ -142,7 +142,7 @@ app.use(connect_st({
|
||||||
// so route it back to /
|
// so route it back to /
|
||||||
app.use(route(function(router) {
|
app.use(route(function(router) {
|
||||||
router.get('/:id', function(request, response, next) {
|
router.get('/:id', function(request, response, next) {
|
||||||
if (request.headers.accept.includes('html')) {
|
if (request.headers.accept && request.headers.accept.includes('html')) {
|
||||||
request.sturl = '/';
|
request.sturl = '/';
|
||||||
next();
|
next();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue