Re: Byte range PATCH

> On Aug 3, 2022, at 02:28, Julian Reschke <julian.reschke@gmx.de> wrote:
> 
> Am 03.08.2022 um 01:11 schrieb Austin William Wright:
>> Hello HTTP WG,
>> 
>> I’m writing to pursue standardization of a PATCH media type to perform
>> writes at specific offsets. This may be especially relevant to
>> draft-tus-httpbis-resumable-uploads-protocol-02, if adopted. It can also
>> serve as the foundation for other features, like segmented uploading,
>> finishing indexes in video files, or other operations that require
>> editing at specific positions in a file.
>> 
>> I wrote and published draft-wright-http-patch-byterange-00
>> <https://www.ietf.org/archive/id/draft-wright-http-patch-byterange-00.html> for
>> your consideration. Please let me know your thoughts.
>> 
>> Thanks,
>> 
>> Austin.
> 
> Hi Austin,
> 
> it's a good idea to work on the media type for byte range patches.
> 
> That said, adding another text-based multipart format makes me shudder
> due to all the inherent problems in parsing field names and choosing
> separator lines.
> 
> I believe a simpler, binary format would be a better choice.
> 
> Best regards, Julian

Hi Julian,

I don’t have terribly strong opinions about what the format is, but this is what I thought was obvious based on a few motivations:

1. It re-uses an existing parser (it’s an off-the-shelf HTTP-message but skipping the "start-line CRLF” beginning, and is trivially parsable with a state machine or regular expression [1]).

2. It allows segments to express HTTP semantics; for example, creating a resource relies on attaching a Content-Type field. You might even attach a Digest field indicating the expected hash of the final resource.

3. It allows for some future extensions (if you omit the “Content-Range” field, you can use a different one to specify the target range).

Would a binary format be able to accomplish this? I know there’s been some work on a binary HTTP message framing but I’m not up-to-date on this.

Thanks,

Austin.


[1] The regular expression for matching the fields a message/byterange document in draft-wright-http-patch-byterange-00 is, excluding obs- productions, is exactly:

/^([!\x23-'\x2a\x2b\x2d\x2e0-9A-Z\x5e-z\x7c~]+:[\t ]*(?:[!-~](?:[\t -~]+[!-~])?)*[\t ]*\r\n)*\r\n/

Received on Wednesday, 3 August 2022 20:36:54 UTC