-
Notifications
You must be signed in to change notification settings - Fork 16
Description
Legacy servers and proxies won't understand the new headers we're defining for PUT to describe patches:
Range:header (called Partial PUT in HTTP)Patch-Type:headerPatches: Nheader
Legacy servers/proxies ignore headers that they don't understand, and thus will happily clobber the contents at their endpoints with the patches themselves, instead of applying them to their contents.
We need guidance on how to avoid this. I propose the following two approaches:
- Clients can do feature detection (TBD) on servers to discover which endpoints are safe to PUT to.
- Braid PUTs can be made to self-destruct on legacy servers by omitting
transfer-encoding: chunkedandcontent-length
- Legacy servers then won't know when the PUT has completed, and won't commit the contents to disk or memory.
- Braid-aware servers will deduce the end of a message from the combination ofPatches: NandPatch-Lengthheaders
The second approach eliminates the ability to use transfer-encoding: chunked with Braid PUTs, which has the downside that we can't stream large patch contents within an update, because the length of each patch must be computed ahead of time. However, the patches themselves can be used to implement streaming, by replacing a single patch with multiple patches. In essence, each "chunk" in transfer-encoding: chunked will become a separate patch. So I don't think we'll lose any functionality this way, although we end up with two ways to do the same thing.
Thoughts on this approach?