Hi,

I see a weird issue with logical OR operator in an ACL:

acl requests-chrome hdr(sec-ch-ua) -m sub \"Not || hdr(sec-ch-ua) -m sub HeadlessChrome || hdr(user-agent) -m sub Chrome
acl requests-linux hdr_sub(user-agent) -i Linux

use-server hrx0-chrome if requests-chrome
use-server hrx0-linux  if requests-linux


I would assume that a client request with this http header:

user-agent: Mozilla/5.0 (Linux; Android 15; SM-S938B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Mobile Safari/537.36

should be using the hrx0-chrome backend in this case because this is defined first, right? I thought the first match should win here, right?

The interesting thing is, if I split up the first ACL into two lines, which should end up with a logical OR, too, it works as expected:


acl requests-chrome hdr(sec-ch-ua) -m sub \"Not || hdr(sec-ch-ua) -m sub HeadlessChrome
acl requests-chrome hdr(user-agent) -m sub Chrome

use-server hrx0-chrome if requests-chrome
use-server hrx0-linux  if requests-linux


In theory this config should be functionally equivalent, right? Actually it's not though. The first one doesn't work for the above mentioned user-agent, the latter one does.

Any idea what's wrong here? This is with haproxy 3.0.29, didn't test later versions yet ...

Cheers
Björn


Reply via email to