Overriding response body and compression handling #632
Replies: 1 comment
-
It is unclear to me what the problem is. Care to elaborate? By the way, it seems you are misusing response body buffering (or maybe not misusing, but it looks incomplete?), have you looked at the docs on response body buffering? All you should have to do is return |
Beta Was this translation helpful? Give feedback.
-
I'm currently overriding response body from origin by first preventing origin from compressing the body via
Accept-Encoding
(set to an empty string) and process each body chunk like so:While this does work for simple html manipulation (i.e. no error is thrown throughout the body process), trying to perform compression would result in a truncated body.
Code snippet using `flate2` crate
Beta Was this translation helpful? Give feedback.
All reactions