envoyproxy/envoy

Support custom formatters in custom request/response headers

Open

#25,571 opened on Feb 15, 2023

View on GitHub
 (7 comments) (0 reactions) (0 assignees)C++ (5,373 forks)batch import
area/httpenhancementhelp wanted

Repository metrics

Stars
 (27,997 stars)
PR merge metrics
 (Avg merge 8d) (378 merged PRs in 30d)

Description

Envoy's standard command operators can be used in the value for custom request/response headers. Please also support custom formatters (or custom command operators?) in addition to the built-in formatters.

Custom formatters are already supported in the access log configuration (see "formatters" in config.core.v3.SubstitutionFormatString), so maybe this can be implemented in a similar way.

Example:

route_config:
  name: local_route
  request_headers_to_add:
  - header:
    key: "x-my-header"
    value: "%MY_CUSTOM_COMMAND_OPERATOR%"

Contributor guide