mirror of
https://github.com/directus/directus.git
synced 2026-01-23 11:47:59 -05:00
Don't check bytesize for empty payloads
This commit is contained in:
@@ -17,7 +17,7 @@ export const respond: RequestHandler = asyncHandler(async (req, res) => {
|
||||
let exceedsMaxSize = false;
|
||||
|
||||
if (env.CACHE_VALUE_MAX_SIZE !== false) {
|
||||
const valueSize = stringByteSize(JSON.stringify(res.locals.payload));
|
||||
const valueSize = res.locals.payload ? stringByteSize(JSON.stringify(res.locals.payload)) : 0;
|
||||
const maxSize = parseBytesConfiguration(env.CACHE_VALUE_MAX_SIZE);
|
||||
exceedsMaxSize = valueSize > maxSize;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user