cloudflare / pingora

A library for building fast, reliable and evolvable network services.
Apache License 2.0
20.21k stars 1.1k forks source link

Fixed `Session::write_response_header_ref` bypassing downstream modules #289

Open palant opened 2 weeks ago

palant commented 2 weeks ago

As mentioned in https://github.com/cloudflare/pingora/issues/206#issuecomment-2168764571, pingora_proxy::Session::write_response_header_ref will currently call directly into the downstream session and bypass downstream modules. This might mess up compression for example.

Instead of duplicating the code triggering modules I decided to make this call Session::write_response_header with a cloned resp – this is how this works anyway, merely a few levels further down.