accepts middleware updated
This commit is contained in:
1 parent
a52b845285
commit
6410409d47
1 file changed
+3
-3
+3
-3
@@ -25,9 +25,9 @@ export function queryObject() {
|
||||
|
||||
export function accepts(routes) {
|
||||
return async function (ctx) {
|
||||
let request = ctx.request
|
||||
let types = Object.keys(routes)
|
||||
.filter(type => request.accepts(type))
|
||||
const types = Object
|
||||
.keys(routes)
|
||||
.filter(type => ctx.request.accepts(type))
|
||||
|
||||
if (types.length) {
|
||||
let fn = routes[types[0]]
|
||||
|
||||
Reference in new issue
Block a user