Accept-Encoding is altered on proxy

#1
I have created a simple python script using sockets, I use openlitespeed to proxy to this http backend, I see openlitespeed is altering accept-encoding in requests headers, only if accept-encoding is equal to "br", the accept-encoding is "br", anything else is converted to "gzip", for example if accept-encoding is equal to "br, deflate", the accept-encoding is converted to "gzip", if accept-encoding is equal to "gzip, br" the accept-encoding is converted to "gzip", only if accept-encoding is equal to "br", the accept-encoding is "br".
 
#2
I actually ran into more problems, I found out that openlitespeed always send 'Accept-Encoding: gzip' to the backend, then decompressed the content, then it removes 'Transfer-Encoding: chunked' from the respond headers but never adds a 'Content-Length', which makes sense the openlitespeed converts chinked data to normal data but cannot buffer all chunked data to count the whole respond, but it should not remove the 'Transfer-Encoding: chunked' and leave chunked data as is. It should also respect the 'Accept-Encoding' from the client, even though the user never sends a 'Accept-Encoding', openlitespeed sends a 'Accept-Encoding: gzip' to have a compressed connection with the backend, openlitespeed decompressed the content but the 'Etag' is for the gzipped content.
 

Pong

Administrator
#3
What's the URL? OLS compression will use "br" if possible. Do you really just juse OLS as proxy? Without proxy setup, does example virtaul host or any other virtaul host has similar problem?
 
#4
Due to my privacy I cannot reveal the domains I'm working on. I use OLS not just as proxy, I use it for everything now. but I explain again, it needs to fix two things:

1. When proxing it should relay 'Accept-Encoding' to the backend and relay the respond to the client as is.

Note: It always request compressed content from the backend and sees it the client want it compressed or uncompressed. (It should have no buffering mode)

2. When it respond in gzip (proxy or without proxy) it should either send a 'Content-Length' if it could buffer it all or, should have 'Transfer-Encoding: chunked' and should send prefixed length chunked data.
 
Top