Commit ec7f298
committed
Fix: Prevent mutation of Next.js cache objects in Redis handler
Redis handler mutated the original `cacheHandlerValue` object Next.js uses for responses. When `parseBuffersToStrings()` converted Buffers to base64, Next.js sent the mutated object to users. So we clone value object before mutation to isolate changes from Next.js's reference.1 parent bbdab95 commit ec7f298
1 file changed
+14
-4
lines changedLines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
232 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
233 | 238 | | |
234 | 239 | | |
235 | 240 | | |
| |||
248 | 253 | | |
249 | 254 | | |
250 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
251 | 261 | | |
252 | 262 | | |
253 | 263 | | |
254 | 264 | | |
255 | 265 | | |
256 | 266 | | |
257 | | - | |
| 267 | + | |
258 | 268 | | |
259 | 269 | | |
260 | 270 | | |
| |||
266 | 276 | | |
267 | 277 | | |
268 | 278 | | |
269 | | - | |
| 279 | + | |
270 | 280 | | |
271 | 281 | | |
272 | 282 | | |
| |||
0 commit comments