-
Notifications
You must be signed in to change notification settings - Fork 835
Description
Background
Prebid.js prebidServerAdapter suggests to use endpointCompression param on the s2sConfig that enables the following behavior:
- Content-Type is text/plain, but body is gzip-compressed
- gzip=1 URL param is added
- Content-Encoding is not set to avoid pre-flight request by the browser
Prebid Server has this code:
prebid-server/endpoints/openrtb2/auction.go
Lines 418 to 430 in 20a81a9
reqContentEncoding := httputil.ContentEncoding(httpRequest.Header.Get("Content-Encoding")) | |
if reqContentEncoding != "" { | |
if !deps.cfg.Compression.Request.IsSupported(reqContentEncoding) { | |
errs = []error{fmt.Errorf("Content-Encoding of type %s is not supported", reqContentEncoding)} | |
return | |
} else { | |
r, err = getCompressionEnabledReader(httpRequest.Body, reqContentEncoding) | |
if err != nil { | |
errs = []error{err} | |
return | |
} | |
} | |
} |
that expects Content-Encoding: gzip
header on the request. Thus Prebid.js and Prebid Server do not meet in their expectations.
Proposed fix
Change the Prebid Server check to rather watch for gzip=1
param on the request and if set then attempt to decompress the request body. Or to watch for either of Content-Encoding: gzip
header (since it is already implemented and somebody may be using it??) or gzip=1
URL param - and then decompress.
Prebid Server Java
It looks like PBS-Java has the same compatibility issue as it is built on Spring Boot with Netty, which typically relies on the Content-Encoding
header to detect and decompress gzipped request bodies.
Related
prebid/Prebid.js#12973 here gzip=1 was implemented
#2438 - apparently the Content-Encoding support appeared earlier in PBS than gzip=1 appeared in PB.js
Metadata
Metadata
Assignees
Labels
Type
Projects
Status