diff --git a/.bruno/fixes/474-queries-crashing-the-server.bru b/.bruno/fixes/474-queries-crashing-the-server.bru index 4c4ae04eb..1f698d7bb 100644 --- a/.bruno/fixes/474-queries-crashing-the-server.bru +++ b/.bruno/fixes/474-queries-crashing-the-server.bru @@ -1,7 +1,7 @@ meta { name: 474 - Queries crashing the server type: http - seq: 2 + seq: 4 } get { diff --git a/.bruno/fixes/475-ability-query-subfields.bru b/.bruno/fixes/475-ability-query-subfields.bru index d7b801e99..1eb57eb08 100644 --- a/.bruno/fixes/475-ability-query-subfields.bru +++ b/.bruno/fixes/475-ability-query-subfields.bru @@ -1,7 +1,7 @@ meta { name: 475 - Ability to query subfileds type: http - seq: 4 + seq: 5 } get { diff --git a/server/src/V2/endpoints/jsonEndpoints.ts b/server/src/V2/endpoints/jsonEndpoints.ts index 9947a1897..711c97c03 100644 --- a/server/src/V2/endpoints/jsonEndpoints.ts +++ b/server/src/V2/endpoints/jsonEndpoints.ts @@ -31,7 +31,7 @@ const endpointToField: Record = { server // Midleware that handle caching only in production and on GET requests - .use(apicache.middleware('1 day', (req: Request) => process.env.NODE_ENV === 'production' && req.method === 'GET', {})) + .use(apicache.middleware('1 day', (req: Request, res: Response) => res.status < 400 && process.env.NODE_ENV === 'production' && req.method === 'GET', {})) // .get('/cache/performance', (req, res) => { // res.json(apicache.getPerformance())