Forum Discussion
Add CORS header to current Irule.
i need to add a CORS header to this Irule. Can someone tell me where it would go?
The CORS header i need added is Access-Control-Allow-Origin: *
Here is our current Irule.
when HTTP_REQUEST {
set json "{ \"message\": {\"title\": \"System Maintenance\", \"body\": \"System is undergoing maintenance.\", \"summary\": \"Please try again later.\" }}"
HTTP::respond 418 content $json "Content-Type" "application/json"
TCP::close
}
At the end of the HTTP::respond it supports headers. Name then Value.
HTTP::respond 418 content $json "Content-Type" "application/json" "Name" "Value" "Name" "Value" ....
- F5_newbieNimbostratus
Thank you. Sometimes seeing things written out in such a simple way immediately clears up the mistake. Mine was that I missed quotes on one of my values. Your example highlighted that to me immediately.
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