Hi.
On 19.11.20 16:16, Maciej Zdeb wrote:
Hi,
Alaksandar I've looked into code and... :)
Great ;-)
śr., 18 lis 2020 o 15:30 Aleksandar Lazic <[email protected]
<mailto:[email protected]>> napisał(a):
Can you think to respectthe '-i'.
http://git.haproxy.org/?p=haproxy.git&a=search&h=HEAD&st=grep&s=PAT_MF_IGNORE_CASE
I'm not sure if I understand you correctly, but in case of http-request del-header the "case
insensitivity" must be always enabled, because header names should be case insensitive
according to RFC. So we should not implement "-i" flag in this scenario.
Well in H2 are the headers in lowercase as far as I understand this part of H2
RFC in a proper way.
But I'm not the expert in H2 so please correct me if I'm wrong.
Hypertext Transfer Protocol Version 2 (HTTP/2)
https://tools.ietf.org/html/rfc7540#section-8.1.2
```
8.1.2. HTTP Header Fields
...
Just as in HTTP/1.x, header field names are strings of ASCII
characters that are compared in a case-insensitive fashion. However,
header field names MUST be converted to lowercase prior to their
encoding in HTTP/2.
...
```
When a H2 client send the header in lowercase then and h1 in mixed-case could the
"del-header"
line not match when it's only written in lowercase or mixed-case .
I think that was also one of the reason why the h1-case-adjust* feature exists
;-)
Additional Info.
What I have see in the the checking of '-i' (PAT_MF_IGNORE_CASE), the '-m
reg' functions
have not the PAT_MF_IGNORE_CASE check.
I think you're looking at the regex execution, but flags are considered during regex compile.
If you look at regex_comp function http://git.haproxy.org/?p=haproxy.git;a=blob;f=src/regex.c;h=45a7e9004e8e4f6ad9604ed9a858aba0060b6204;hb=0217b7b24bb33d746d2bf625f5e894007517d1b0#l312 you'll notice cs param. Function is called in pattern.c and couple other places. In my opinion -i with -m reg is perfectly valid and should work.
Cool great, I thought I missed something.
Thanks for the clarification.
Regards
Aleks