envoyproxy / envoy

Cloud-native high-performance edge/middle/service proxy
https://www.envoyproxy.io
Apache License 2.0
25.14k stars 4.83k forks source link

Substitution Formatter w/o Headers/HTTP Components #20818

Open llu94 opened 2 years ago

llu94 commented 2 years ago

Title: Substitution Formatters That Don't Required Headers/HTTP Components

Description:

As a follow on to https://github.com/envoyproxy/envoy/issues/19685 it was discovered that Envoy does not have substitution formatters independent of HTTP components. These formatters would be useful even in network modules and they should be developed.

[optional Relevant Links:] https://github.com/envoyproxy/envoy/issues/19685 https://github.com/envoyproxy/envoy/tree/main/source/common/formatter

lambdai commented 2 years ago

Now that your input is stream info, Could you use the StreamInfoHeaderFormatter? https://github.com/envoyproxy/envoy/blob/main/source/common/router/header_formatter.h#L36

Note that the Header is actually string, not a http header map.

llu94 commented 2 years ago

That can be done.