Header and trailer sections consist of zero or more field lines; see Section 5
of [HTTP]. The format of a field section depends on whether the message is
known- or intermediate-length.¶
Each field line includes a name and a value. Both the name and value are
non-zero length sequences of bytes. The format of a field line is shown in
Figure 6.¶
For field names, byte values that are not permitted in an HTTP field name cause
the message to be invalid; see Section 5.1 of [HTTP] for a definition of
what is valid and Section 4 for handling of invalid messages.¶
In addition, values from the ASCII uppercase range (0x41-0x5a inclusive) MUST
be translated to lowercase values (0x61-0x7a) when generating or forwarding
messages. A recipient MUST treat a message containing field names with bytes in
the range 0x41-0x5a as invalid; see Section 4.¶
For field values, byte values that are not permitted in an HTTP field value
cause the message to be invalid; see Section 5.5 of [HTTP] for a definition
of valid values.¶
The same field name can be repeated in multiple field lines; see Section 5.2 of
[HTTP] for the semantics of repeated field names and rules for combining
values.¶
Like HTTP/2, this format has an exception for the combination of multiple
instances of the Cookie
field. Instances of fields with the ASCII-encoded
value of cookie
are combined using a semicolon octet (0x3b) rather than a
comma; see Section 8.1.2.5 of [H2].¶
This format provides fixed locations for content that would be carried in
HTTP/2 pseudo-fields. Therefore, there is no need to include field lines
containing a name of :method
, :scheme
, :authority
, :path
, or :status
.
Fields that contain one of these names cause the message to be invalid; see
Section 4. Pseudo-fields that are defined by protocol extensions MAY be
included, however field lines containing pseudo-fields MUST precede other field
lines.¶