fix: ignore ParsedUrlQuery modification for serve (#300)

* fix: ignore ParsedUrlQuery modification for serve

* fix: check if icon is undefined before trying to set it
pull/302/head
Amio 2019-07-18 16:21:34 +08:00 zatwierdzone przez GitHub
commit 944b7fc868
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -69,7 +69,9 @@ export function badgenServe (handlers: BadgenServeHandlers): Function {
params.subject = simpleDecode(params.subject)
params.status = simpleDecode(params.status)
query.icon = icon === '' ? params.subject : icon
if (icon !== undefined) {
query.icon = icon === '' ? params.subject : icon
}
if (query.style === undefined) {
const host = req.headers['x-forwarded-host'] || req.headers.host