Skip to main content

Module version

Module version 

Source
Expand description

Version negotiation.

Two rules, both checked by the suite. Every response carries UHP-Version naming the contract it was served under, so a client never has to guess. And a request naming a version this server does not speak is refused with 400, not served under a different one — silently substituting hands the client a body it may not be able to parse, which is worse than a clean refusal.

Constants§

HEADER
The negotiation header, in both directions.
SUPPORTED
Every version this server can serve.
VERSION
The only protocol version this server implements.

Functions§

negotiate
Refuse a request for a version we do not speak; stamp every answer with the version it was served under.