Support forwarded host

pull/287/head
Amio 2019-06-12 19:05:13 +08:00
rodzic 3c2fec4506
commit 18ae78f6c8
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -48,7 +48,8 @@ export function badgenServe (handlers: BadgenServeHandlers): Function {
params.status = simpleDecode(params.status)
if (query.style === undefined) {
if ((req.headers[':authority'] || req.headers.host).startsWith('flat')) {
const host = req.headers['x-forwarded-host'] || req.headers.host
if (host.startsWith('flat')) {
query.style = 'flat'
}
}