Closed sag-celejd closed 1 year ago
We support gzip compression for incoming requests. This feature is disabled by default. To enable it, set the enable_gzip
config value to true
.
So sounds like this is a docs issue... adding that label.
Thanks for the response.
Can you guys point me to where you actually handle incoming compressed requests in the code? I'm only seeing that https://github.com/NYTimes/gziphandler is being used to gzip the response.
I am aware of enable_gzip but that only seems to be relevant for the bidder adapters.
Maybe I expressed myself poorly. I might be doing something wrong but what I'm saying is that e.g. a request like so does not seem to be supported:
echo '{"foo": "bar"}' | gzip | curl -v -i --data-binary @- -H "Content-Encoding: gzip" --request POST https://foo.bar/openrtb2/auction
I'm only seeing that https://github.com/NYTimes/gziphandler is being used to gzip the response.
Huh. It seems I misremembered that the NYTimes handler just handles the response, not the request.
I would be willing to prepare a pull request if this seems fine.
Sounds good to me. Please still utilize the LimitedReader
so we have protection from large requests and from zip bombs.
To support incoming GZIP compressed PBS requests would be also useful in:
-server 2 server traffic - in SSAI and DOOH applications.
-in client side traffic to lower bandwidth (mobile) data transfer.
However gzip decompress could be also most probable done in loadbalancer before PBS.
Implemented in PBS-Go 0.259.0.
The current endpoints do not seem to support any type of compression for incoming requests. Looking at the code naively e.g. in auction.go, a quick implementation looks somewhat simple:
Is there anything speaking against this approach - maybe I'm missing something. I would be willing to prepare a pull request if this seems fine.