0

I want to rename the exiting header in envoy configuration but I cant find any related document expect Access header values by name from header modification options where has no response. Is there any solution for this requirement in envoy?

mohammad_1m2
  • 1,571
  • 5
  • 19
  • 38

1 Answers1

1

There isn't any built in filter to achieve this requirement, but it is possible with the lua http filter.

   name: envoy.lua
   typed_config:
     "@type": type.googleapis.com/envoy.config.filter.http.lua.v2.Lua
       inline_code: |
         function envoy_on_request(request_handle)

         local originalHeader = request_handle:headers():get("A")

         if originalHeader then
         -- Use 'replace' instead of 'add' to overwrite any existing value of the target header 
           request_handle:headers():replace("B", originalHeader) 
           request_handle:headers():remove("A")
         end
       end
Amith Sewnarain
  • 655
  • 6
  • 11