-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug/Permit deleting db entries with leading slashes #218
Conversation
@@ -241,8 +231,9 @@ async def delete(self, key: str) -> None: | |||
Raises: | |||
KeyError: Key does not exist | |||
""" | |||
body, content_type = encode_multipart_formdata({"key": key}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there plans to use multipart for other requests than delete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Loose plans, yes. We already support multipart for set, migrating that codepath as well could be beneficial.
We currently have a gap for get
that could be benefitted by some out-of-band encoding, but POST
for "get" semantics isn't great. Unfortunately the urlspace for get is already pretty crowded, which is why this PR is just to permit people to delete the keys they've set but can't otherwise read.
When called without a refresh function we end up getting AttributeError: 'AsyncDatabase' object has no attribute '_refresh_timer' on attempted close. Fix this.
66f5cb1
to
dd7bfd8
Compare
…t supports deleting keys with leading slashes
dd7bfd8
to
6821562
Compare
Why
A second attempt at #172, considering #172 (comment).
What changed
We added a DELETE method which supports
multipart/form-data
with fieldskey=${dbkey}
. Canonical cURL example follows:curl "$REPLIT_DB_URL" -X DELETE -F key=/my/slashy/key
Test plan
Rollout
Describe any procedures or requirements needed to roll this out safely (or check the box below)