Add header Vary Accept-Language (#4588)
* nginx: add header Vary Accept-Language
solves #3647
* Revert "nginx: add header Vary Accept-Language"
This reverts commit 90dccf5324
.
* add resp header Vary Accept-Language
solves #3647
* don't add vary header to embed page
This commit is contained in:
parent
decbd0b63b
commit
5fc44b57f8
|
@ -138,31 +138,31 @@ async function generateEmbedHtmlPage (req: express.Request, res: express.Respons
|
|||
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) {
|
||||
|
|
|
@ -555,9 +555,13 @@ class ClientHtml {
|
|||
}
|
||||
}
|
||||
|
||||
function sendHTML (html: string, res: express.Response) {
|
||||
function sendHTML (html: string, res: express.Response, localizedHTML: boolean = false) {
|
||||
res.set('Content-Type', 'text/html; charset=UTF-8')
|
||||
|
||||
if (localizedHTML) {
|
||||
res.set('Vary', 'Accept-Language')
|
||||
}
|
||||
|
||||
return res.send(html)
|
||||
}
|
||||
|
||||
|
@ -586,5 +590,5 @@ export {
|
|||
async function generateHTMLPage (req: express.Request, res: express.Response, paramLang?: string) {
|
||||
const html = await ClientHtml.getDefaultHTMLPage(req, res, paramLang)
|
||||
|
||||
return sendHTML(html, res)
|
||||
return sendHTML(html, res, true)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue