accepts middleware updated

This commit is contained in:
tmshv committed 2018-05-23 10:21:28 +03:00
1 parent a52b845285
commit 6410409d47
1 file changed
+3 -3
+3 -3
View File
@@ -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]]