envoyproxy/envoy

Allow stateful and stateless header formatters to both be configured

Open

#17.661 geöffnet am 10. Aug. 2021

Auf GitHub ansehen
 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C++ (5.373 Forks)batch import
area/httphelp wanted

Repository-Metriken

Stars
 (27.997 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 8T) (378 gemergte PRs in 30 T)

Beschreibung

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.

Contributor Guide