oxidecomputer / oxidecomputer/dropshot

`ClientSpecifiesVersionInHeader` doesn't set `Vary` header

Open
#1,628 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.2k
Forks
104
Avg merge
1d 19h
Merged PRs (30d)
22

Description

The ClientSpecifiesVersionInHeader type provides an implementation of DynamicVersionPolicy which allows for versioning APIs according to an HTTP header. Currently ClientSpecifiesVersionInHeader does not add the specified version header to the Vary response header. This means that if a Dropshot server ends up behind a caching proxy, the proxy has no way of knowing that the response body can only be re-used for requests with the same version header set, meaning that clients instead end up getting responses for API versions that they don't support.

It's not entirely clear to me how best to resolve this, but presumably the DynamicVersionPolicy trait would need to provide a way of setting at least the Vary header for responses. It might make sense to allow setting any header though, which would allow for e.g. returning the requested version as a response header as well, meaning that the response would be more self-describing.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the ClientSpecifiesVersionInHeader implementation and the DynamicVersionPolicy trait, then inspect existing versioning tests and response-header handling. Determine the intended policy API and verify that responses vary on the specified version header, with tests covering requests through a caching proxy or equivalent header behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.