zwoop commented on code in PR #12304: URL: https://github.com/apache/trafficserver/pull/12304#discussion_r2153304495
########## doc/admin-guide/plugins/header_rewrite.en.rst: ########## @@ -142,6 +142,23 @@ with the word ``else``. The following example illustrates this:: The ``else`` clause is not a condition, and does not take any flags, it is of course optional, but when specified must be followed by at least one operator. +You can also do an ``elif`` (else if) clause, which is specified by starting a new line +with the word ``elif``. The following example illustrates this:: + + cond %{STATUS} >399 [AND] + cond %{STATUS} <500 + set-status 404 + elif + cond %{STATUS} =503 + set-status 502 + else + set-status 503 + +Keep in mind that nesting the ``else`` and ``elif`` clauses is not allowed, but any +number of ``elif`` clauses can be specified. We can consider these clauses are more +powerful and flexible ``switch`` statement. In an ``if-elif-else`` rule, only one +will be evaluate its operators. Review Comment: Added. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@trafficserver.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org