Fix timeout logic (#3774)

Close #3773
This commit is contained in:
Paul Melnikow
2019-07-24 22:51:25 -05:00
committed by GitHub
parent ead56cdf49
commit 3f891e4a1f

View File

@@ -185,12 +185,7 @@ function handleRequest(cacheHeaderConfig, handlerOptions) {
{}
)
const svg = makeBadge(badgeData)
let extension
try {
extension = match[0].split('.').pop()
} catch (e) {
extension = 'svg'
}
const extension = (match.slice(-1)[0] || '.svg').replace(/^\./, '')
setCacheHeadersOnResponse(ask.res)
makeSend(extension, ask.res, end)(svg)
}, 25000)