* Middleware overhaul! - Remove unnecessary 'async' keywords from middleware functions - Ensure all middleware functions we create have names - Wrap the method contents of all async middleware functions in a try-catch+next(error) pattern * Use asyncMiddleware wrapper instead of try-catch+next(error) pattern * Remove unnecessary try-catch+next(error) pattern from context middleware
8 lines
252 B
JavaScript
8 lines
252 B
JavaScript
module.exports = function disableCachingOnSafari (req, res, next) {
|
|
const isSafari = /^((?!chrome|android).)*safari/i.test(req.headers['user-agent'])
|
|
if (isSafari) {
|
|
res.header('Last-Modified', (new Date()).toUTCString())
|
|
}
|
|
return next()
|
|
}
|