envoyproxy/envoy

Allow stateful and stateless header formatters to both be configured

Open

#17.661 aberto em 10 de ago. de 2021

Ver no GitHub
 (3 comments) (0 reactions) (0 assignees)C++ (5.373 forks)batch import
area/httphelp wanted

Métricas do repositório

Stars
 (27.997 stars)
Métricas de merge de PR
 (Mesclagem média 8d) (378 fundiu PRs em 30d)

Description

Title: Allow stateful and stateless header formatters to both be configured

Description: Currently the header formatter extension point allows the definition of using a stateful header key formatter, or a stateless formatter, but not both at the same time. An example of a stateful formatter is the preserve case formatter, for the stateless there is only the ProperCase formatter currently.

During the review of #15619 it was mentioned that it would be useful to allow stacked formatters, or at least the Proper Case formatter in addition to a stateful formatter. The use case mentioned during that PR was for Envoy generated headers.

Another use case is if the downstream connection is HTTP/2, but upstream clusters are doing HTTP/1.1. In this use case the stateful formatter will not be created and will not be passed to the upstream request. In this case, it could be useful to allow the Stateless formatter.

The requested feature is to allow exactly one stateful formatter, but additionally allow configuration of the Proper Case formatter. It does not cover stacked stateful formatters.

Originally I was thinking this could be limited to the case where there is no stateful formatter to use the stateless formatter attached to the connection. However, now I'm wondering if it would be clearer if the change would be to have a configured stateless formatter only act on unmodified headers in the event that a stateful formatter did not modify the header. Open to suggestions.

Guia do colaborador