PUT: Add initial support #63

Open
Ghost wants to merge 3 commits from (deleted):feat/put/add-support into master
First-time contributor

Initial implementation. Not thoroughly tested yet.

Fixes: #62

~~Initial implementation. Not thoroughly tested yet.~~ Fixes: https://git.0x0.st/mia/0x0/issues/62
Ghost added 1 commit 2022-09-26 17:56:21 +02:00
Ghost added 1 commit 2022-09-26 18:13:38 +02:00
Ghost added 1 commit 2022-11-28 07:58:19 +01:00
Owner

If we’re going to add PUT support, we might as well use the appropriate response codes (so it returns 201 for newly created files and 200 for existing files, each with the Location header field). Those can be the same for POST requests.

There must also be a way to specify any additional parameters using header fields (e.g. X-Expires).

I want to support DELETE as well, which I plan to do with a random key that is attached to the response headers for the initial upload. That functionality should be available for the POST interface as well.

I will implement deletion support separately from this PR.

If we’re going to add PUT support, we might as well use the appropriate response codes (so it returns 201 for newly created files and 200 for existing files, each with the `Location` header field). Those can be the same for POST requests. There must also be a way to specify any additional parameters using header fields (e.g. `X-Expires`). I want to support DELETE as well, which I plan to do with a random key that is attached to the response headers for the initial upload. That functionality should be available for the POST interface as well. I will implement deletion support separately from this PR.
mia reviewed 2022-11-29 23:46:40 +01:00
@ -79,3 +79,64 @@ def test_client(client):
rv = client.get(p)
assert rv.status_code == code
def test_client_put(client):
Owner

There shouldn’t be so much duplication here.

There shouldn’t be so much duplication here.
Owner

File deletion is implemented now.

File deletion is implemented now.
This pull request has changes conflicting with the target branch.
  • templates/index.html
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mia/0x0#63
No description provided.