Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

HttpTrailerFieldAllowed

function HttpTrailerFieldAllowed(const aName, aValue: RawByteString): Boolean; overload;
THE TRAILER-FIELD POLICY every wire applies to trailers it receives and to those a handler generates (HTTP.txt, sections 2.2 and 2.3). The wire sessions and SetTrailers call these; a handler does not need to. HttpTrailerFieldAllowed: True when aName is a token, aValue holds no control character but HTAB and no DEL, and the name is not one trailers may not carry - fields that affect framing, routing, connection handling, authentication, request modifiers or payload interpretation (content-length, host, authorization, cookie, range, content-type and the like). Outer SP/HTAB in aValue is accepted here; each wire applies its own whitespace and lowercase-name rules. HttpTrailerNameInConnection: True when aName is one of the comma-separated names in aConnection, a Connection field value (any case); such a name is refused as well. HttpTrailerAccountField: adds the field's cost - name and value length plus 32 - to the running total aBytes and answers True when the total stays within aLimit (0: no limit beyond MaxInt div 2). False leaves aBytes unchanged: refuse the section. The 32 per field bounds the number of fields as well as their text. The RawByteString overloads take wire octets as they are; the UnicodeString overloads check, and count, the UTF-8 encoding.
function HttpTrailerFieldAllowed(const aName, aValue: UnicodeString): Boolean; overload;