All problems

Webhook Receiver Loses Trace IDs When Header Names Use Different Casing

Level 2 · node · API · Missing case-insensitive lookup of HTTP header names

Scenario

A fictional equipment-event webhook receiver records a trace ID for each incoming request. Some device adapters pass through raw HTTP headers as an object that preserves header-name casing. HTTP header names are case-insensitive, but the current receiver looks up only a lowercase key. When an adapter sends 'X-Trace-Id', the receiver logs a fallback ID instead, breaking trace correlation.

Requirements

Find the x-trace-id value in a raw header object regardless of header-name casing. If the header is absent, use 'trace-unset'. Do not modify the trace ID value. Preserve the response contract containing the event ID and recorded trace ID.

Acceptance criteria

  • A lowercase x-trace-id header retains its value.
  • A mixed-case X-Trace-Id header is recognized.
  • An uppercase X-TRACE-ID header is recognized.
  • When the header is missing, the fallback is used and the event ID is preserved.