aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-30 13:37:11 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-30 13:37:11 +0100
commit4f49137101a665f6a76bd8159a175a2aa680af96 (patch)
tree97f4956a2ae4642fefbd67f2839f4ab525e00821 /server.ts
parent6cae49d26299b22ed879156ba5b8fb68a34e3713 (diff)
downloadPeerTube-4f49137101a665f6a76bd8159a175a2aa680af96.tar.gz
PeerTube-4f49137101a665f6a76bd8159a175a2aa680af96.tar.zst
PeerTube-4f49137101a665f6a76bd8159a175a2aa680af96.zip
Fix req accepts
Diffstat (limited to 'server.ts')
-rw-r--r--server.ts4
1 files changed, 2 insertions, 2 deletions
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) {
29 throw new Error('Your configuration files miss keys: ' + missed) 29 throw new Error('Your configuration files miss keys: ' + missed)
30} 30}
31 31
32import { API_VERSION, CONFIG, STATIC_PATHS } from './server/initializers/constants' 32import { ACCEPT_HEADERS, API_VERSION, CONFIG, STATIC_PATHS } from './server/initializers/constants'
33checkFFmpeg(CONFIG) 33checkFFmpeg(CONFIG)
34 34
35const errorMessage = checkConfig() 35const 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)
131app.use('/*', function (req, res) { 131app.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