trafficserver icon indicating copy to clipboard operation
trafficserver copied to clipboard

HRW: Add support for elif, in if-elif-else

Open zwoop opened this issue 5 months ago • 1 comments

This adds an elif clause to the conditions. E.g.

cond %{SEND_RESPONSE_HDR_HOOK} [AND]
cond %{CLIENT-HEADER:X-Foo} ="foo"
   set-header X-Resp "foo"
elif
    cond %{CLIENT-HEADER:X-Foo} ="bar"
        set-header X-Resp "bar"
elif
    cond %{CLIENT-HEADER:X-Foo} ="baz"
        set-header X-Resp "baz"
else
   set-header X-Resp "else"

In addition, this cleans up the handling of the existing "else" clause, and I ran clang-tidy over the two files I was editing.

Co-author: Miles L.

zwoop avatar Jun 17 '25 21:06 zwoop

[approve ci osx]

zwoop avatar Jun 18 '25 14:06 zwoop

[approve ci]

zwoop avatar Jun 23 '25 22:06 zwoop