aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-09-25 11:13:34 +0200
committerChocobozzz <me@florianbigard.com>2018-09-25 11:13:34 +0200
commitaac0118dc3a563f4923426ec580a8491874922f4 (patch)
tree32e2f30336485efa4cac264b20d0695091553b32
parent4ebf25fda02cc19cbb0919f2595234c7e945596f (diff)
downloadPeerTube-aac0118dc3a563f4923426ec580a8491874922f4.tar.gz
PeerTube-aac0118dc3a563f4923426ec580a8491874922f4.tar.zst
PeerTube-aac0118dc3a563f4923426ec580a8491874922f4.zip
Fix dnt route
-rwxr-xr-xscripts/build/server.sh1
-rw-r--r--server/controllers/static.ts6
2 files changed, 5 insertions, 2 deletions
diff --git a/scripts/build/server.sh b/scripts/build/server.sh
index 41b59a212..bd4d1bf47 100755
--- a/scripts/build/server.sh
+++ b/scripts/build/server.sh
@@ -5,3 +5,4 @@ set -eu
5rm -rf ./dist 5rm -rf ./dist
6 6
7npm run tsc 7npm run tsc
8cp -r "./server/static" "./dist"
diff --git a/server/controllers/static.ts b/server/controllers/static.ts
index 63f78b3b3..baafe1ac4 100644
--- a/server/controllers/static.ts
+++ b/server/controllers/static.ts
@@ -1,5 +1,4 @@
1import * as cors from 'cors' 1import * as cors from 'cors'
2import { createReadStream } from 'fs-extra'
3import * as express from 'express' 2import * as express from 'express'
4import { CONFIG, ROUTE_CACHE_LIFETIME, STATIC_DOWNLOAD_PATHS, STATIC_MAX_AGE, STATIC_PATHS } from '../initializers' 3import { CONFIG, ROUTE_CACHE_LIFETIME, STATIC_DOWNLOAD_PATHS, STATIC_MAX_AGE, STATIC_PATHS } from '../initializers'
5import { VideosPreviewCache } from '../lib/cache' 4import { VideosPreviewCache } from '../lib/cache'
@@ -10,6 +9,8 @@ import { VideosCaptionCache } from '../lib/cache/videos-caption-cache'
10import { UserModel } from '../models/account/user' 9import { UserModel } from '../models/account/user'
11import { VideoCommentModel } from '../models/video/video-comment' 10import { VideoCommentModel } from '../models/video/video-comment'
12import { HttpNodeinfoDiasporaSoftwareNsSchema20 } from '../../shared/models/nodeinfo' 11import { HttpNodeinfoDiasporaSoftwareNsSchema20 } from '../../shared/models/nodeinfo'
12import { join } from 'path'
13import { root } from '../helpers/core-utils'
13 14
14const packageJSON = require('../../../package.json') 15const packageJSON = require('../../../package.json')
15const staticRouter = express.Router() 16const staticRouter = express.Router()
@@ -118,7 +119,8 @@ staticRouter.use('/.well-known/dnt-policy.txt',
118 asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.DNT_POLICY)), 119 asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.DNT_POLICY)),
119 (_, res: express.Response) => { 120 (_, res: express.Response) => {
120 res.type('text/plain') 121 res.type('text/plain')
121 createReadStream('./server/static/dnt-policy/dnt-policy-1.0.txt').pipe(res) 122
123 return res.sendFile(join(root(), 'server/static/dnt-policy/dnt-policy-1.0.txt'))
122 } 124 }
123) 125)
124 126