diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-30 13:37:11 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-30 13:37:11 +0100 |
commit | 4f49137101a665f6a76bd8159a175a2aa680af96 (patch) | |
tree | 97f4956a2ae4642fefbd67f2839f4ab525e00821 /server.ts | |
parent | 6cae49d26299b22ed879156ba5b8fb68a34e3713 (diff) | |
download | PeerTube-4f49137101a665f6a76bd8159a175a2aa680af96.tar.gz PeerTube-4f49137101a665f6a76bd8159a175a2aa680af96.tar.zst PeerTube-4f49137101a665f6a76bd8159a175a2aa680af96.zip |
Fix req accepts
Diffstat (limited to 'server.ts')
-rw-r--r-- | server.ts | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -29,7 +29,7 @@ if (missed.length !== 0) { | |||
29 | throw new Error('Your configuration files miss keys: ' + missed) | 29 | throw new Error('Your configuration files miss keys: ' + missed) |
30 | } | 30 | } |
31 | 31 | ||
32 | import { API_VERSION, CONFIG, STATIC_PATHS } from './server/initializers/constants' | 32 | import { ACCEPT_HEADERS, API_VERSION, CONFIG, STATIC_PATHS } from './server/initializers/constants' |
33 | checkFFmpeg(CONFIG) | 33 | checkFFmpeg(CONFIG) |
34 | 34 | ||
35 | const errorMessage = checkConfig() | 35 | const errorMessage = checkConfig() |
@@ -129,7 +129,7 @@ app.use('/', staticRouter) | |||
129 | 129 | ||
130 | // Always serve index client page (the client is a single page application, let it handle routing) | 130 | // Always serve index client page (the client is a single page application, let it handle routing) |
131 | app.use('/*', function (req, res) { | 131 | app.use('/*', function (req, res) { |
132 | if (req.accepts('html')) { | 132 | if (req.accepts(ACCEPT_HEADERS) === 'html') { |
133 | return res.sendFile(path.join(__dirname, '../client/dist/index.html')) | 133 | return res.sendFile(path.join(__dirname, '../client/dist/index.html')) |
134 | } | 134 | } |
135 | 135 | ||