.. _config_http_conn_man_header_casing: HTTP/1.1 Header Casing ====================== When handling HTTP/1.1, Envoy will normalize the header keys to be all lowercase. While this is compliant with the HTTP/1.1 spec, in practice this can result in issues when migrating existing systems that might rely on specific header casing. To support these use cases, Envoy allows :ref:`configuring a formatting scheme for the headers `, which will have Envoy transform the header keys during serialization. To configure this formatting on response headers, specify the format in the :ref:`http_protocol_options `. To configure this for upstream request headers, specify the formatting in :ref:`http_protocol_options ` in the cluster's :ref:`extension_protocol_options`. Currently Envoy supports two mutually exclusive types of header key formatters: Stateless formatters -------------------- Stateless formatters are run on encoding and do not depend on any previous knowledge of the headers. An example of this type of formatter is the :ref:`proper case words ` formatter. These formatters are useful when converting from non-HTTP/1 to HTTP/1 (within a single proxy or across multiple hops) or when stateful formatting is not desired due to increased memory requirements. Stateful formatters ------------------- Stateful formatters are instantiated on decoding, called for every decoded header, attached to the header map, and are then available during encoding to format the headers prior to writing. Thus, they traverse the entire proxy stack. An example of this type of formatter is the :ref:`preserve case formatter ` configured via the :ref:`stateful_formatter ` field. The following is an example configuration which will preserve HTTP/1 header case across the proxy. .. literalinclude:: _include/preserve-case.yaml :language: yaml