* Removed unnecessary math operator from lolisafe.js.

* Updated comment about HttpErrorPages (the branch was renamed from "fiery-me" to "fiery.me").
This commit is contained in:
Bobby Wibowo 2018-02-10 06:20:34 +07:00
parent 677d8717e7
commit 49cf3b0654
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF

View File

@ -34,9 +34,8 @@ safe.use(bodyParser.json())
const setHeaders = (res, path, stat) => {
if (/\.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso|js|css|eot|svg|ttf|woff|woff2)$/.test(path)) {
const day = 86400
res.set('Access-Control-Allow-Origin', '*')
res.set('Cache-Control', `public, max-age=${day * 30}, must-revalidate, proxy-revalidate, immutable, stale-while-revalidate=86400, stale-if-error=604800`) // 30 days
res.set('Cache-Control', `public, max-age=2592000, must-revalidate, proxy-revalidate, immutable, stale-while-revalidate=86400, stale-if-error=604800`) // max-age: 30 days
}
}
@ -60,7 +59,7 @@ for (let page of config.pages) {
}
}
// NOTE: Uses fiery-me branch of https://github.com/BobbyWibowo/HttpErrorPages
// NOTE: Uses fiery.me branch of https://github.com/BobbyWibowo/HttpErrorPages
safe.use((req, res, next) => {
res.status(404).sendFile('HTTP404.html', { root: '../HttpErrorPages/dist/' })
})