victor_romero_1
Feb 03, 2011Nimbostratus
illegal argument using HTTP::respond
Hi,
Our application servers return a 200 OK message even if it should be a 404 or 500 error code, so we want to capture that using an iRule and return the right error code depending on the message returned by our app servers:
when HTTP_RESPONSE_DATA {
set page_not_found "The requested page was not found."
set page_not_live "The requested page is not live."
if { ([HTTP::payload] contains "$page_not_found") } {
HTTP::respond 404
}
if { ([HTTP::payload] contains "$page_not_live) } {
HTTP::respond 500
}
}
It seems to be working as expected, however we see in the /var/ltm/log files the following error message:
- Illegal argument. Can't execute in the current context. invoked from within "HTTP::payload"
I take the only mandatory attribute for the HTTP::respond is the error code.
HTTP::respond status_code [content] [noserver] [header_name header value]+
We're using BIG-IP 9.4.8 Build 407.0 hotfix hf4
Any ideas?
Many thanks,
Victor