import { root } from '../helpers/core-utils'
import { STATIC_MAX_AGE } from '../initializers/constants'
import { ClientHtml, sendHTML, serveIndexHTML } from '../lib/client-html'
-import { asyncMiddleware, disableRobots, embedCSP } from '../middlewares'
+import { asyncMiddleware, embedCSP } from '../middlewares'
const clientsRouter = express.Router()
res.status(HttpStatusCode.NOT_FOUND_404).end()
})
-// No index exceptions
-clientsRouter.all('/about/peertube',
- disableRobots,
- asyncMiddleware(serveIndexHTML)
-)
-
// Always serve index client page (the client is a single page application, let it handle routing)
// Try to provide the right language index.html
clientsRouter.use('/(:language)?', asyncMiddleware(serveIndexHTML))
async function generateWatchHtmlPage (req: express.Request, res: express.Response) {
const html = await ClientHtml.getWatchHTMLPage(req.params.id + '', req, res)
- return sendHTML(html, res)
+ return sendHTML(html, res, true)
}
async function generateWatchPlaylistHtmlPage (req: express.Request, res: express.Response) {
const html = await ClientHtml.getWatchPlaylistHTMLPage(req.params.id + '', req, res)
- return sendHTML(html, res)
+ return sendHTML(html, res, true)
}
async function generateAccountHtmlPage (req: express.Request, res: express.Response) {
const html = await ClientHtml.getAccountHTMLPage(req.params.nameWithHost, req, res)
- return sendHTML(html, res)
+ return sendHTML(html, res, true)
}
async function generateVideoChannelHtmlPage (req: express.Request, res: express.Response) {
const html = await ClientHtml.getVideoChannelHTMLPage(req.params.nameWithHost, req, res)
- return sendHTML(html, res)
+ return sendHTML(html, res, true)
}
async function generateActorHtmlPage (req: express.Request, res: express.Response) {
const html = await ClientHtml.getActorHTMLPage(req.params.nameWithHost, req, res)
- return sendHTML(html, res)
+ return sendHTML(html, res, true)
}
async function generateManifest (req: express.Request, res: express.Response) {