Commit a3fcdb0
fix(storage): escape SQL wildcards in KV prefix queries, log parse errors (#73)
C1: Escape `%`, `_`, and `\` in user-supplied prefix before building the
LIKE clause in `kvList`, and add `ESCAPE '\\'` to the query so wildcard
characters in key prefixes cannot bypass prefix-boundary filtering.
C3: Add `console.warn` in `parseJsonField` and `parseStringArray` so
corrupt stored values surface in Cloudflare Worker logs instead of
silently returning null / [].
Fixes #72.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent e60974f commit a3fcdb0
1 file changed
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | | - | |
| 54 | + | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| |||
258 | 260 | | |
259 | 261 | | |
260 | 262 | | |
261 | | - | |
262 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
263 | 266 | | |
264 | 267 | | |
265 | 268 | | |
| |||
0 commit comments