Contains vs starts_with behavior

In 11.x code, when the following is used, the LTM responds with a 504. when HTTP_RESPONSE { if {[HTTP::status] contains “5”} { HTTP::redirect “/client-error.html” } }

If contains is replaced with starts_with, the redirect appears to work as intended. Knowing the starts_with is the preferred method to avoid unintended matches, why would it respond with a 504 for contains?

Anything in /var/log/ltm when the problem occurs?

I doubt ‘contains’ is valid with this command; ‘contains 5’ could be a 500 or a 205 and isn’t really specific enough considering the HTTP status code structure. The requirement to perform some action based on a status code (such as in your case) shouldn’t be so loosely defined. ‘starts_with’ will work as at least you are defining a type of error, if not a specific one. Make sense?