Skip to content

Guidance for PUTs to legacy servers #117

@toomim

Description

@toomim

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: header
  • Patches: N header

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:

  1. Clients can do feature detection (TBD) on servers to discover which endpoints are safe to PUT to.
  2. Braid PUTs can be made to self-destruct on legacy servers by omitting transfer-encoding: chunked and content-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 of Patches: N and Patch-Length headers

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions