aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/controllers/static.ts6
1 files changed, 4 insertions, 2 deletions
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