Skip to content

VIP 30: bereq.body_filters

Nils Goroll edited this page May 25, 2020 · 1 revision

Synopsis

Add VDP filters on the request body to be sent to the backend

Why?

Varnish can already transform response bodies both on their way into the cache with Varnish Fetch Processors (VFPs) and out of the cache to the client with Varnish Delivery Processors (VDPs). Yet there is no current option to transform request bodies to be sent to backends.

The specific use case is to add upload encryption support to the Encrypted Content Encoding (ECE) VMOD.

How?

Analogous to resp.filters, add bereq.body_filters on the backend side to contain VDPs which are to process the request body when sent to the backend and implement that processing.

Notes

While bereq.filters would be unambiguous as as name, bereq.body_filters is proposed to hint towards the fact that these are applied to the less commonly used request body. bereq.req_body_filters was also considered, but dismissed due to the stuttering req.req. Better suggestions are welcome.

Optionally, req.body_filters could also be added to the request body with VFPs on the client side, but as there is no currently known use case, this addition is not proposed herein. Also, the implementation might be slightly more complicated due to the existing request body cache code on the client side.

Clone this wiki locally