Forum Discussion
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?
2 Replies
- Mohamed_Lrhazi
Altocumulus
Anything in /var/log/ltm when the problem occurs? - What_Lies_Bene1
Cirrostratus
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?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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