
O Apache 2.2 não possui a <if>
diretiva, então estou tentando contornar a falta de lógica explícita se/então, atribuindo um valor padrão a uma variável, mas substituindo-o se o cabeçalho da solicitação incluir um parâmetro Origin:
<IfModule mod_headers.c>
SetEnvIfNoCase ORIGIN ".+" ORIGINVAR=ORIGIN
SetEnvIfNoCase ORIGIN "^$" ORIGINVAR="*"
Header always set Access-Control-Allow-Origin: %{ORIGINVAR}e
</IfModule>
No entanto, não consigo atribuir o valor ORIGINVAR ORIGIN, tentei:
ORIGIN
HTTP_ORIGIN
%{ORIGIN}e
%{ORIGIN}
"%{ORIGIN}e"
"%{ORIGIN}"
Todos eles apenas retornam a string exata, sem resolver a variável.