Skip to content

Feature-request : Implement Other Putmodes for HttpStore #844

Description

@giridher-art

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

HttpStore::put_opts only supports PutMode::Overwrite. Using PutMode::Create or PutMode::Update returns Error::NotImplemented. Every other backend (aws, azure, gcp) already supports both, so HttpStore can't be used for optimistic-concurrency writes (e.g. create-if-absent, update-if-unchanged).

Describe the solution you'd like

Implement PutMode::Create and PutMode::Update for HttpStore using standard HTTP conditional headers:

  • PutMode::Create → If-None-Match: *
  • PutMode::Update(v) → If-Match: "<v.e_tag>"

Map failures back to existing error types:

  • Create + 412 → Error::AlreadyExists
  • Update + 412 → Error::Precondition

Describe alternatives you've considered

Using the WebDAV If header (RFC 2518 §9.4) instead — not needed here since it's built for lock tokens, and PutMode only needs ETag-based conditions. Plain If-Match/If-None-Match is simpler and works on more generic HTTP servers.

Additional context

Not all servers honor conditional headers on PUT — this is optional server behavior. This change does not add WebDAV locking support.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions