Skip to content

Commit bd273ac

Browse files
committed
feat: process possible JSON:API responses on excluded paths
1 parent 4cebb85 commit bd273ac

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/middleware.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,11 @@ export const jsonApiRequestMiddleware = (
2929
const excludeRegexp = options?.excludedPaths ? buildExcludeRegExp(options.excludedPaths) : null;
3030

3131
return async (context, next) => {
32-
if (excludeRegexp?.test(context.path)) {
33-
return next();
34-
}
35-
3632
context.state.jsonApi = {
3733
acceptableTypes: getAcceptableMediaTypes(context.get("Accept")),
3834
};
3935

40-
if (validateContentType(context)) {
36+
if (!excludeRegexp?.test(context.path) || validateContentType(context)) {
4137
await next();
4238
}
4339

0 commit comments

Comments
 (0)