Commit 4a5a7ac
[FIX] Prevent keys from starting with slashes (#172)
* [FIX] Prevent keys from starting with slashes
If a key starts with a slash, then it becomes undeletable and prevents database purges from working properly as well.
This prevents that from occuring by stripping slashes from the left of the key name.
* Double newlines for flake8
* flake8 wanted another newline here
* Force `set_bulk_raw` to handle keys with slashes as well
* Add tests for keys starting with a slash
* Fix a typo I made twice
* flake8
* `del self.db[k]` not `self.db.delete(k)` in non-Async
* One space for flake8
* These were also wrong
* These shouldn't be using `get`
* Match format of some of the other tests in TestDatabase
* Perhaps the key is corrupted?
* Have to `get_raw` for `_raw` calls.
* Reassociate _dumps with def dumps
* Only call keyStrip at the root of the .set function hierarchy
* Clarify that keyStrip is an internal method
---------
Co-authored-by: Devon Stewart <devon.stewart@repl.it>1 parent 5c0ab7a commit 4a5a7ac
2 files changed
+69
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
64 | 76 | | |
65 | 77 | | |
66 | 78 | | |
| |||
195 | 207 | | |
196 | 208 | | |
197 | 209 | | |
| 210 | + | |
198 | 211 | | |
199 | 212 | | |
200 | 213 | | |
| |||
629 | 642 | | |
630 | 643 | | |
631 | 644 | | |
| 645 | + | |
632 | 646 | | |
633 | 647 | | |
634 | 648 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
128 | 155 | | |
129 | 156 | | |
130 | 157 | | |
| |||
259 | 286 | | |
260 | 287 | | |
261 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
0 commit comments