Forum Discussion
CORS irule query
I am looking to enable my F5 to send CORS headers.
I tried implementing the following irule but this broke my access to the website though I was able to test the CORS header. Am I missing something here.
when HTTP_REQUEST { clientside { HTTP::header insert Access-Control-Allow-Credentials true HTTP::header insert Access-Control-Allow-Origin * } }
4 Replies
- Kevin_Stewart
Employee
- zeesh86_123075
Nimbostratus
I have tried those irules. The CORS headers works but the site is not accessible anymore.
- Kevin_Stewart
Employee
A more appropriate version of your iRule would look like this:
when HTTP_REQUEST { HTTP::header insert Access-Control-Allow-Credentials true HTTP::header insert Access-Control-Allow-Origin * }The HTTP_REQUEST event already operates in the client side context, so the clientside command is not necessary. As for CORS functionality, if you post a capture of what it should look like when it works natively, it may make it easier to emulate here.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com