http_trailer_test

The http_trailer_test rule option is used to perform various tests on a specific HTTP trailer field. The tests that can be performed in this option include a test to see whether the trailer field's value is numeric or not, a check to see whether a trailer field's value is within a given range, and a check to see whether a given field is absent.

This rule option takes a few different arguments, one of which is the name of the trailer field to run the tests against. Specifying this field is done with the field argument followed by the name of the field we want to test. The subsequent arguments are the specific tests to run against that particular field, and rule writers can specify multiple tests at once by separating them with commas.

As mentioned above, there are three tests that can be performed on a given trailer. First is the numeric test to check if a given field is numeric or not. This argument requires specifying either true or false after it to look for numeric trailers and non-numeric trailers, respectively.

Next is the check argument, which is used to check a numeric trailer against a given number range. This range is specified after check, and the format for specifying a range is described below.

Last is the absent argument, which simply checks if a given field is absent.

Format:

http_trailer_test:field trailer_name[,numeric {true|false}][,check range][,absent];

A range can either be a single value comparison:

[<|>|=|!|<=|>=]number

Or it can be a range between two integer values:

min_number{<>|<=>}max_number

Examples:

# check that Expires trailer value is numeric 
http_trailer_test:field expires,numeric true;