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) {
|
export function accepts(routes) {
|
||||||
return async function (ctx) {
|
return async function (ctx) {
|
||||||
let request = ctx.request
|
const types = Object
|
||||||
let types = Object.keys(routes)
|
.keys(routes)
|
||||||
.filter(type => request.accepts(type))
|
.filter(type => ctx.request.accepts(type))
|
||||||
|
|
||||||
if (types.length) {
|
if (types.length) {
|
||||||
let fn = routes[types[0]]
|
let fn = routes[types[0]]
|
||||||
|
|||||||
Reference in new issue
Block a user