docs/middleware/disable-caching-on-safari.js

8 строки
216 B
JavaScript

module.exports = (req, res, next) => {
const isSafari = /^((?!chrome|android).)*safari/i.test(req.headers['user-agent'])
if (isSafari) {
res.header('Last-Modified', (new Date()).toUTCString())
}
next()
}