mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-19 04:57:54 +00:00
Merge pull request #1132 from tahoe-lafs/3806-switch-to-patch-for-http-uploads
Switch to PATCH for http uploads Fixes ticket:3806
This commit is contained in:
commit
cf48397e72
@ -482,8 +482,8 @@ The response includes ``already-have`` and ``allocated`` for two reasons:
|
||||
This might be because a server has become unavailable and a remaining server needs to store more shares for the upload.
|
||||
It could also just be that the client's preferred servers have changed.
|
||||
|
||||
``PUT /v1/immutable/:storage_index/:share_number``
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
``PATCH /v1/immutable/:storage_index/:share_number``
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
Write data for the indicated share.
|
||||
The share number must belong to the storage index.
|
||||
@ -531,6 +531,24 @@ The response code:
|
||||
and no change is made.
|
||||
|
||||
|
||||
Discussion
|
||||
``````````
|
||||
|
||||
``PUT`` verbs are only supposed to be used to replace the whole resource,
|
||||
thus the use of ``PATCH``.
|
||||
From RFC 7231::
|
||||
|
||||
An origin server that allows PUT on a given target resource MUST send
|
||||
a 400 (Bad Request) response to a PUT request that contains a
|
||||
Content-Range header field (Section 4.2 of [RFC7233]), since the
|
||||
payload is likely to be partial content that has been mistakenly PUT
|
||||
as a full representation. Partial content updates are possible by
|
||||
targeting a separately identified resource with state that overlaps a
|
||||
portion of the larger resource, or by using a different method that
|
||||
has been specifically defined for partial updates (for example, the
|
||||
PATCH method defined in [RFC5789]).
|
||||
|
||||
|
||||
``POST /v1/immutable/:storage_index/:share_number/corrupt``
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
@ -684,19 +702,19 @@ Immutable Data
|
||||
|
||||
#. Upload the content for immutable share ``7``::
|
||||
|
||||
PUT /v1/immutable/AAAAAAAAAAAAAAAA/7
|
||||
PATCH /v1/immutable/AAAAAAAAAAAAAAAA/7
|
||||
Content-Range: bytes 0-15/48
|
||||
<first 16 bytes of share data>
|
||||
|
||||
200 OK
|
||||
|
||||
PUT /v1/immutable/AAAAAAAAAAAAAAAA/7
|
||||
PATCH /v1/immutable/AAAAAAAAAAAAAAAA/7
|
||||
Content-Range: bytes 16-31/48
|
||||
<second 16 bytes of share data>
|
||||
|
||||
200 OK
|
||||
|
||||
PUT /v1/immutable/AAAAAAAAAAAAAAAA/7
|
||||
PATCH /v1/immutable/AAAAAAAAAAAAAAAA/7
|
||||
Content-Range: bytes 32-47/48
|
||||
<final 16 bytes of share data>
|
||||
|
||||
|
0
newsfragments/3806.minor
Normal file
0
newsfragments/3806.minor
Normal file
Loading…
Reference in New Issue
Block a user