16 lines
246 B
JavaScript
16 lines
246 B
JavaScript
function redirectFragment() {
|
|
return async (ctx, next) => {
|
|
const query = ctx.query
|
|
|
|
console.log(query)
|
|
|
|
if ('_escaped_fragment_' in query) {
|
|
ctx.redirect(ctx.path)
|
|
} else {
|
|
await next()
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = redirectFragment
|