@@ -44,12 +44,12 @@ defmodule RigInboundGateway.ApiProxy.Handler.Kafka do
4444 any ( ) }
4545 def kafka_handler ( message , headers ) do
4646 case ResponseFromParser . parse ( headers , message ) do
47- { deserialized_pid , response_code , response } ->
47+ { deserialized_pid , response_code , response , extra_headers } ->
4848 Logger . debug ( fn ->
4949 "HTTP response via Kafka to #{ inspect ( deserialized_pid ) } : #{ inspect ( message ) } "
5050 end )
5151
52- send ( deserialized_pid , { :response_received , response , response_code } )
52+ send ( deserialized_pid , { :response_received , response , response_code , extra_headers } )
5353
5454 err ->
5555 Logger . warn ( fn -> "Parse error #{ inspect ( err ) } for #{ inspect ( message ) } " end )
@@ -257,7 +257,7 @@ defmodule RigInboundGateway.ApiProxy.Handler.Kafka do
257257 conf = config ( )
258258
259259 receive do
260- { :response_received , response , response_code } ->
260+ { :response_received , response , response_code , extra_headers } ->
261261 ProxyMetrics . count_proxy_request (
262262 conn . method ,
263263 conn . request_path ,
@@ -268,6 +268,9 @@ defmodule RigInboundGateway.ApiProxy.Handler.Kafka do
268268
269269 conn
270270 |> Tracing.Plug . put_resp_header ( Tracing . context ( ) )
271+ |> Map . update! ( :resp_headers , fn existing_headers ->
272+ existing_headers ++ Map . to_list ( extra_headers )
273+ end )
271274 |> Conn . put_resp_content_type ( "application/json" )
272275 |> Conn . send_resp ( response_code , response )
273276 after
0 commit comments