We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4cebb85 commit bd273acCopy full SHA for bd273ac
src/middleware.ts
@@ -29,15 +29,11 @@ export const jsonApiRequestMiddleware = (
29
const excludeRegexp = options?.excludedPaths ? buildExcludeRegExp(options.excludedPaths) : null;
30
31
return async (context, next) => {
32
- if (excludeRegexp?.test(context.path)) {
33
- return next();
34
- }
35
-
36
context.state.jsonApi = {
37
acceptableTypes: getAcceptableMediaTypes(context.get("Accept")),
38
};
39
40
- if (validateContentType(context)) {
+ if (!excludeRegexp?.test(context.path) || validateContentType(context)) {
41
await next();
42
}
43
0 commit comments