RewriteCond %{ENV:isInternal} 0
RewriteCond %{ENV:X_ADA_PRODTYPE} !^$
RewriteRule . - [E=X_ADA_ORIGIN_URL:%{HTTP:Origin}]

<If "! reqenv('X_ADA_ORIGIN_URL') =~ / /">
    Header set Access-Control-Allow-Origin %{X_ADA_ORIGIN_URL}e env=X_ADA_ORIGIN_URL
    Header merge Vary Origin
    Header set X_ADA_INTERNAL "1" "expr=env('isInternal') = '1'"

    Header always set Access-Control-Allow-Credentials true
    Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
    Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"
    # Header always set X-Frame-Options "*"
    Header set Cache-Control "no-cache, no-store, must-revalidate"
    Header set Pragma "no-cache"
    Header set Expires 0
</If>
