Forum Discussion
JRahm
Admin
Hi Patricio_quirog, I'm no expert on apache configs...but I think this duplicates the logic. Test for sure before rolling anything to a production environment:
when HTTP_REQUEST {
set host [HTTP::host]
if { $host ends_with “tgr.cl” } {
set origin_match 1
} else { ## what to do if it does not match? }
}
when HTTP_RESPONSE {
if { [info exists origin_match] } {
HTTP::header remove Access-Control-Allow-Origin
HTTP::header remove Access-Control-Allow-Credentials
HTTP::header insert Access-Control-Allow-Origin $host
HTTP::header insert Access-Control-Allow-Credentials true
}
}
Patricio_quirog
Nov 03, 2022Altocumulus
thanks and for sure put into a test enviroment first.