Error Codes Wiki

HTTP Trailer Headers — Chunked Response Metadata and Checksum Errors

Informational2xx success

Overview

Fix HTTP trailer header implementation errors for sending metadata like checksums and digests after chunked response body transmission.

Key Details

  • HTTP trailer headers are sent after the chunked response body, allowing metadata computed during streaming
  • Common use cases include content checksums, message digests, and processing status after streaming
  • The Trailer header in the initial response declares which headers will appear in the trailers
  • Not all HTTP clients and proxies support trailer headers — they may silently discard them
  • gRPC relies heavily on trailers for status codes and error messages

Common Causes

  • Client or proxy not supporting HTTP trailer headers and silently dropping them
  • Missing Trailer declaration header in the initial response
  • Attempting to use restricted headers (Transfer-Encoding, Content-Length, Host) as trailers
  • Server framework not providing API for writing trailer headers after the body

Steps

  1. 1Declare trailers upfront: add 'Trailer: Digest, Server-Timing' header to the initial response
  2. 2Send trailer headers after the final chunk: they appear after the zero-length terminating chunk
  3. 3Only use trailers for non-critical metadata — clients that do not support them will miss the data
  4. 4Test with curl --raw to see trailer headers in the response output
  5. 5For critical metadata, consider including it in both the trailer and a predictable response body location

Tags

trailerchunkedmetadatachecksumgrpc

More in 2xx Success

Frequently Asked Questions

Trailers send metadata computed during response generation, such as content checksums, timing data, or processing status. gRPC uses trailers extensively for status codes and error details.