I’ve been tasked with creating an iRule that searches for a header of ‘screen’ and field of ‘ABC’. The iRule (or part of iRule) is below:
} elseif {[string tolower [HTTP::header value screen]] equals "ABC" and ${cert-check} != 1 } {
HTTP::respond 403
(pls ignore the Cert check) The header check seems to be working as expected when 1 header is included, as per below. (Successful test provides a 403, failed test provides a 404).
[root:Active] config curl -I https://1.1.1.1/ -H "screen: ABC" -k
HTTP/1.0 403 Forbidden
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root:Active] config curl -I https://1.1.1.1/ -H "screen: abc" -k
HTTP/1.0 403 Forbidden
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
However when I add two Headers I get (the latter 404 means its not being picked up by the iRule):
[root:Active] config curl -I https://1.1.1.1/ -H "screen: logon" -H "screen: abc" -k
HTTP/1.0 403 Forbidden
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root:Active] config curl -I https://1.1.1.1/ -H "screen: abc" -H "screen: logon" -k
HTTP/1.1 404 Not Found
Connection: close
Date: Tue, 08 Oct 2013 23:55:18 GMT
Content-Length: 1214
Content-Type: text/html
X-Powered-By: Servlet/2.4 JSP/2.0
Can anyone identify whats incorrect or needs to be amended on the iRule to resolve this?