Hello,
I’ve got a problem with upgrade HAproxy in my envinronment.
After upgrade from HAproxy v.1.9.x to v.2.4.x, I noticed that HTTP response was changed:
HTTP response from new version HAproxy:
> Content-Length: 17730
>
* upload completely sent off: 17730 out of 17730 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 201
HTTP/1.1 201
< location: http://HOST:PORT/SOME/URI
location: http://HOST:PORT/SOME/URI
< content-length: 0
content-length: 0
< date: Tue, 08 Mar 2022 12:10:58 GMT
date: Tue, 08 Mar 2022 12:10:58 GMT<
* Connection #0 to host HOST left intact
HTTP response from old version HAproxy:
> Content-Length: 17730
>
* upload completely sent off: 17730 out of 17730 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 201
HTTP/1.1 201
< Location: http://HOST:PORT/SOME/URI
Location: http://HOST:PORT/SOME/URI
< Content-Length: 0
Content-Length: 0
< Date: Tue, 08 Mar 2022 12:11:54 GMT
Date: Tue, 08 Mar 2022 12:11:54 GMT<
* Connection #0 to host HOST left intact
Like you see headers from new version of HAproxy are writter in lower-case and some apps (parsers) in my envinroment are case-sensitive.
To resolve this issue I was trying to add no option http-use-htx
to my config but this doesn’t work for HAproxy v.2.x Since the version 2.0-dev3, the HTX is the default mode
[WARNING] (23) : parsing [/opt/haproxy/config/haproxy.cfg:16]: option 'http-use-htx' is deprecated and ignored. The HTX mode is now the only supported mode.
So I was able to rewrite specific headers using h1-case-adjust
:
global
h1-case-adjust content-length Content-Length
h1-case-adjust location Location
h1-case-adjust date Date
frontend proxy
option h1-case-adjust-bogus-client
But this solution it’s not enough for me because I don’t know every header that is used in my envinroment and I don’t want to rewirte every problematic HTTP header in HAproxy config file.
Could you tell me is there any other solution that will make HTTP headers in old (traditional) HTTP representation?
Best regards,
emilwojcik93