FM-026 Authorization, Localization, and HTTP Semantics

HTTP Content-Negotiation Failures

The API ignores the Accept header and returns a different format, or mishandles Content-Type and rejects a valid request.

Failure explanation

The consumer requests a representation using Accept or declares a request representation using Content-Type, but the server or intermediary ignores or mishandles those headers. A gateway may strip vendor media types, the server may return JSON when XML was requested, or an unsupported type may be accepted silently. This creates responses that are syntactically valid but incompatible with the consumer’s contract.

Example

The client sends Accept: application/vnd.acme.order-v2+json, but a gateway removes the vendor media type. The backend returns the default v1 JSON representation with HTTP 200.

How to test

  • Test supported, unsupported, missing, wildcard, and weighted Accept values.
  • Test supported and unsupported request Content-Type values.
  • Verify 406 and 415 behavior where applicable.
  • Inspect whether gateways preserve media-type parameters and response Vary headers.

Expected behavior

The server selects a supported representation according to documented negotiation rules or returns the documented error. It must not silently return an incompatible representation.

Runnable examples

Each example includes a broken server, a fixed server, an OpenAPI spec, and a clrsig scenario that detects the failure.