Context: Header Operation docs are lying

#1
When hovering the little `(i)` in the "Header Operations", you are presented with:


Code:
Specifies additional response/request headers to be added. Multiple header directives can be added with one directive per line. "NONE" can be used to disable parent header inheritance. If no directive is provided 'Header' is assumed.

Syntax: [Header]|RequestHeader [condition] set|append|merge|add|unset header [value] [early|env=[!]variable]

Example: set Cache-control no-cache
append Cache-control no-store
Header set My-header cust_header_val
RequestHeader set My-req-header cust_req_header_val
But the webserver doesn't respect any of these.

  • The condition is supposed to be "always" or "onsuccess", as per the Apache documentation. But setting this like:

    Code:
    Header onsuccess set X-Foo "Bar"
    Will actually add a header called ONSUCCESS:

    Code:
    # curl -IXGET https://......
    onsuccess: set X-Foo "Bar"
  • The env part is completely ignored, or always seem to be true, no matter if that environment variable exists or not. For example:

    Header set X-Foo "Bar" env=MOO

    The header will ALWAYS be set, no matter if the MOO variable exists or not
Further more, it doesn't actually seem that ANY env vars are actually being evaluated in the Header Operations anyway. If you set a variable in a Rewrite Rules, this doesn't actually become available in the Headers Operations.

The Documentation of OpenLiteSpeed is severely lacking, and doesn't actually offer any examples on how to use the conditions or env vars in any way.
 
#2
Thanks for the report. The `always` is supported and is the default value. onsuccess is not.
I will forward this to the dev team.
 
Last edited:
Top