kouriada_284551
Oct 03, 2018Nimbostratus
Access-control-allow-origin changing according domains
Hi guys,
I would like to ask about your help.
I have to apply multiple Access-control-allow-origin for particular domains via irule
Description of the task is something like this:
When a client is going from domain A to source portal, the response should containt header Access-control-allow-origin domain A
When a client is going from domain B to source portal, the response should containt header Access-control-allow-origin domain B
etc
I need to see only header which contain particular domain * which I came from as a client
I was able to create only this:
when HTTP_RESPONSE {
if !{[HTTP::header exists "Access-Control-Allow-Origin"]} {
HTTP::header insert Access-Control-Allow-Origin "domain A"
HTTP::header insert Access-Control-Allow-Origin "domain B"
HTTP::header insert Access-Control-Allow-Origin "domain C"} }
but it doesnt do what I need and I am not able to create some conditional in that irule for particular domain and I see all CORS headers in one time via curl
I have been trying to do this via policy but, it seems to me that it doesnt work as well
I appreciate any help
AK