Skip to content

Commit 541089c

Browse files
committed
patch byterange: Add discussion about truncation
1 parent db709b3 commit 541089c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

draft-wright-http-patch-byterange.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,21 @@ Byte range PATCH cannot by itself be used to recover from an interrupted PUT tha
556556
One technique would be to use a 1xx interim response to indicate a location where the partial upload is being stored. If PUT request is interrupted, the client can make PATCH requests to this temporary, non-atomic location to complete the upload. When the last part is uploaded, the original interrupted PUT request will finish.
557557

558558

559+
## Truncation
560+
561+
One currently unspecified operation that could be useful is the ability to resize the document without specifying any content for it. Especially truncating the document to zero bytes, or some other length. The unsatisfied-range form could potentially be used this:
562+
563+
~~~ example
564+
PATCH /logs.txt HTTP/1.1
565+
Content-Type: message/byterange
566+
Content-Length: 28
567+
If-Match: "foo"
568+
569+
Content-Range: bytes */0
570+
571+
~~~
572+
573+
559574
## Splicing and Binary Diff
560575

561576
Operations more complicated than standard filesystem operations are out of scope for this media type. A feature of byte range patch is an upper limit on the complexity of applying the patch. In contrast, prepending, splicing, replace, or other complicated file operations could potentially require the entire file on disk be rewritten.

0 commit comments

Comments
 (0)