http_status_matches()

Determines whether the HTTP status matches or does not match any of the statuses in the supplied fmt string.

Returns true when the status matches any of the strings and returns false otherwise. If fmt is prefixed with !, returns true when the status does not match any of the strings and returns false if it does. Statuses in the string are separated by commas.

This function is not prefixed with the std. namespace.

Format

BOOL
http_status_matches(INTEGER status, STRING fmt)

Examples

1
2
3
if (http_status_matches(beresp.status, "!200,301,302")) {
  set obj.cacheable = 0;
}