mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-12 23:46:22 +00:00
Updates
* 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:
parent
677d8717e7
commit
49cf3b0654
@ -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/' })
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user