From 4f49137101a665f6a76bd8159a175a2aa680af96 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 30 Nov 2017 13:37:11 +0100 Subject: Fix req accepts --- server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server.ts') diff --git a/server.ts b/server.ts index a723dd32b..39caf8996 100644 --- a/server.ts +++ b/server.ts @@ -29,7 +29,7 @@ if (missed.length !== 0) { throw new Error('Your configuration files miss keys: ' + missed) } -import { API_VERSION, CONFIG, STATIC_PATHS } from './server/initializers/constants' +import { ACCEPT_HEADERS, API_VERSION, CONFIG, STATIC_PATHS } from './server/initializers/constants' checkFFmpeg(CONFIG) const errorMessage = checkConfig() @@ -129,7 +129,7 @@ app.use('/', staticRouter) // Always serve index client page (the client is a single page application, let it handle routing) app.use('/*', function (req, res) { - if (req.accepts('html')) { + if (req.accepts(ACCEPT_HEADERS) === 'html') { return res.sendFile(path.join(__dirname, '../client/dist/index.html')) } -- cgit v1.2.3