Header constructor

Header(
  1. String name,
  2. String? value, [
  3. HeaderEncoding encoding = HeaderEncoding.none
])

Creates a new header

Line breaks in name and value are replaced by a single space, so that a header value can neither start another header nor terminate the header section (header injection). Folding is applied in render.

Implementation

Header(String name, String? value, [this.encoding = HeaderEncoding.none])
  : name = sanitize(name),
    value = value == null ? null : sanitize(value),
    lowerCaseName = sanitize(name).toLowerCase();