Skip to content
This repository was archived by the owner on Mar 20, 2024. It is now read-only.

Commit 300b16a

Browse files
authored
Merge pull request #28 from bartzy/fix-querystring-cache-key
Fix the cache key for complex querystrings
2 parents b8c1e7b + aee8b61 commit 300b16a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const generateCacheKey = (model, ctx) => {
2323
const suffix = Object
2424
.keys(query)
2525
.sort()
26-
.map(k => `${k}=${query[k]}`)
26+
.map(k => `${k}=${JSON.stringify(query[k])}`)
2727
.join(',');
2828
const cacheKey = `${prefix}?${suffix}`;
2929

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "strapi-middleware-cache",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "Cache strapi requests",
55
"main": "./lib",
66
"scripts": {

0 commit comments

Comments
 (0)