ctx => app.context

This commit is contained in:
Pooya Parsa 2017-10-25 01:08:31 +03:30
parent aefa9f8c31
commit 5384ee1a5c

View File

@ -125,7 +125,7 @@ export async function setContext(app, context) {
if (context.res) app.context.res = context.res
app.context.redirect = function (status, path, query) {
if (!status) return
ctx._redirected = true // Used in middleware
app.context._redirected = true // Used in middleware
// if only 1 or 2 arguments: redirect('/') or redirect('/', { foo: 'bar' })
if (typeof status === 'string' && (typeof path === 'undefined' || typeof path === 'object')) {
query = path || {}