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 * } }
- Kevin_StewartEmployee
- zeesh86_123075Nimbostratus
I have tried those irules. The CORS headers works but the site is not accessible anymore.
- Kevin_StewartEmployee
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.
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