Skip to main content

protocol_headers

Function protocol_headers 

Source
pub fn protocol_headers() -> HeaderMap
Expand description

The request half of the protocol handshake, as default headers for a reqwest client.

Every route the server gates requires X-Capsule-Protocol and refuses without it (capsule-server/src/negotiation.rs, issue #404), and X-Capsule-Crypto-Suite names the suite this build seals under. Both are constants of the build, so they belong on the transport once rather than on every call: a reqwest default header rides every request the client sends, the spargen-generated operations included. A header set explicitly on a request still wins, which is how the hand-written upload path keeps pinning a per-transport protocol date.

X-Capsule-Sidecar-Schema rides along too (#404, #520). The design has clients send it on metadata updates, and this build writes exactly one sidecar schema (SIDECAR_SCHEMA_V1), so it is a constant of the build like the suite rather than a property of one write. On the transport, every request that carries a sidecar carries the number — including a metadata update reached through a generated operation no hand-written path wraps — and the server validates it only when present, so a request that carries no sidecar is unaffected by it.