Combine cache control (#33067)
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import { cacheControlFactory } from './cache-control.js'
|
||||
|
||||
const cacheControl = cacheControlFactory(60 * 60)
|
||||
import { defaultCacheControl } from './cache-control.js'
|
||||
|
||||
export default function trailingSlashes(req, res, next) {
|
||||
if (req.method === 'GET' || req.method === 'HEAD' || req.method === 'OPTIONS') {
|
||||
@@ -14,7 +12,7 @@ export default function trailingSlashes(req, res, next) {
|
||||
if (split.length) {
|
||||
url += `?${split.join('?')}`
|
||||
}
|
||||
cacheControl(res)
|
||||
defaultCacheControl(res)
|
||||
return res.redirect(301, url)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user