<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.6.26 (Ruby 3.1.3) -->
<?rfc tocindent="yes"?>
<?rfc strict="yes"?>
<?rfc compact="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-ietf-httpbis-retrofit-06" category="std" consensus="true" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.17.0 -->
  <front>
    <title abbrev="Retrofit Structured Fields">Retrofit Structured Fields for HTTP</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-retrofit-06"/>
    <author initials="M." surname="Nottingham" fullname="Mark Nottingham">
      <organization/>
      <address>
        <postal>
          <postalLine>Prahran</postalLine>
          <postalLine>Australia</postalLine>
        </postal>
        <email>mnot@mnot.net</email>
        <uri>https://www.mnot.net/</uri>
      </address>
    </author>
    <date/>
    <area>Applications and Real-Time</area>
    <workgroup>HTTP</workgroup>
    <keyword>structured fields</keyword>
    <keyword>http</keyword>
    <abstract>
      <t>This specification nominates a selection of existing HTTP fields as having syntax that is compatible with Structured Fields, so that they can be handled as such (subject to certain caveats).</t>
      <t>To accommodate some additional fields whose syntax is not compatible, it also defines mappings of their semantics into new Structured Fields. It does not specify how to negotiate their use.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-ietf-httpbis-retrofit/"/>.
      </t>
      <t>
        Discussion of this document takes place on the
        HTTP Working Group mailing list (<eref target="mailto:ietf-http-wg@w3.org"/>),
        which is archived at <eref target="https://lists.w3.org/Archives/Public/ietf-http-wg/"/>.
        Working Group information can be found at <eref target="https://httpwg.org/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/httpwg/http-extensions/labels/retrofit"/>.</t>
    </note>
  </front>
  <middle>
    <section anchor="introduction">
      <name>Introduction</name>
      <t>Structured Field Values for HTTP <xref target="STRUCTURED-FIELDS"/> introduced a data model with associated parsing and serialization algorithms for use by new HTTP field values. Fields that are defined as Structured Fields can realise a number of benefits, including:</t>
      <ul spacing="normal">
        <li>Improved interoperability and security: precisely defined parsing and serialisation algorithms are typically not available for fields defined with just ABNF and/or prose.</li>
        <li>Reuse of common implementations: many parsers for other fields are specific to a single field or a small family of fields.</li>
        <li>Canonical form: because a deterministic serialisation algorithm is defined for each type, Structure Fields have a canonical representation.</li>
        <li>Enhanced API support: a regular data model makes it easier to expose field values as a native data structure in implementations.</li>
        <li>Alternative serialisations: While <xref target="STRUCTURED-FIELDS"/> defines a textual serialisation of that data model, other, more efficient serialisations of the underlying data model are also possible.</li>
      </ul>
      <t>However, a field needs to be defined as a Structured Field for these benefits to be realised. Many existing fields are not, making up the bulk of header and trailer fields seen in HTTP traffic on the internet.</t>
      <t>This specification defines how a selection of existing HTTP fields can be handled as Structured Fields, so that these benefits can be realised -- thereby making them Retrofit Structured Fields.</t>
      <t>It does so using two techniques. <xref target="compatible"/> lists compatible fields -- those that can be handled as if they were Structured Fields due to the similarity of their defined syntax to that in Structured Fields. <xref target="mapped"/> lists mapped fields -- those whose syntax needs to be transformed into an underlying data model which is then mapped into that defined by Structured Fields.</t>
      <t>Note that while implementations can parse and serialise compatible fields as Structured Fields subject to the caveats in <xref target="compatible"/>, a sender cannot generate mapped fields from <xref target="mapped"/> and expect them to be understood and acted upon by the recipient without prior negotiation. This specification does not define such a mechanism.</t>
      <section anchor="notational-conventions">
        <name>Notational Conventions</name>
        <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
      </section>
    </section>
    <section anchor="compatible">
      <name>Compatible Fields</name>
      <t>The HTTP fields listed in <xref target="compatible-fields"/> can usually have their values handled as Structured Fields according to the listed parsing and serialisation algorithms in <xref target="STRUCTURED-FIELDS"/>, subject to the listed caveats.</t>
      <t>The listed types are chosen for compatibility with the defined syntax of the field as well as with actual internet traffic. However, not all instances of these fields will successfully parse. This might be because the field value is clearly invalid, or it might be because it is valid but not parseable as a Structured Field.</t>
      <t>An application using this specification will need to consider how to handle such field values. Depending on its requirements, it might be advisable to reject such values, treat them as opaque strings, or attempt to recover a structured value from them in an ad hoc fashion.</t>
      <table anchor="compatible-fields">
        <name>Compatible Fields</name>
        <thead>
          <tr>
            <th align="left">Field Name</th>
            <th align="left">Structured Type</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left">Accept</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Accept-Encoding</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Accept-Language</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Accept-Patch</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Accept-Post</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Accept-Ranges</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Access-Control-Allow-Credentials</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">Access-Control-Allow-Headers</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Access-Control-Allow-Methods</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Access-Control-Allow-Origin</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">Access-Control-Expose-Headers</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Access-Control-Max-Age</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">Access-Control-Request-Headers</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Access-Control-Request-Method</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">Age</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">Allow</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">ALPN</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Alt-Svc</td>
            <td align="left">Dictionary</td>
          </tr>
          <tr>
            <td align="left">Alt-Used</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">Cache-Control</td>
            <td align="left">Dictionary</td>
          </tr>
          <tr>
            <td align="left">CDN-Loop</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Clear-Site-Data</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Connection</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Content-Encoding</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Content-Language</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Content-Length</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Content-Type</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">Cross-Origin-Resource-Policy</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">DNT</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">Expect</td>
            <td align="left">Dictionary</td>
          </tr>
          <tr>
            <td align="left">Expect-CT</td>
            <td align="left">Dictionary</td>
          </tr>
          <tr>
            <td align="left">Host</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">Keep-Alive</td>
            <td align="left">Dictionary</td>
          </tr>
          <tr>
            <td align="left">Max-Forwards</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">Origin</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">Pragma</td>
            <td align="left">Dictionary</td>
          </tr>
          <tr>
            <td align="left">Prefer</td>
            <td align="left">Dictionary</td>
          </tr>
          <tr>
            <td align="left">Preference-Applied</td>
            <td align="left">Dictionary</td>
          </tr>
          <tr>
            <td align="left">Retry-After</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">Sec-WebSocket-Extensions</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Sec-WebSocket-Protocol</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Sec-WebSocket-Version</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">Server-Timing</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Surrogate-Control</td>
            <td align="left">Dictionary</td>
          </tr>
          <tr>
            <td align="left">TE</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Timing-Allow-Origin</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Trailer</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Transfer-Encoding</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">Upgrade-Insecure-Requests</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">Vary</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">X-Content-Type-Options</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">X-Frame-Options</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">X-XSS-Protection</td>
            <td align="left">List</td>
          </tr>
        </tbody>
      </table>
      <t>Note the following caveats regarding compatibility:</t>
      <dl>
        <dt>Parsing differences:</dt>
        <dd>
          <t>Some values may fail to parse as Structured Fields, even though they are valid according to their originally specified syntax. For example, HTTP parameter names are case-insensitive (per <xref section="5.6.6" sectionFormat="of" target="HTTP"/>), but Structured Fields require them to be all-lowercase.
Likewise, many Dictionary-based fields (e.g., Cache-Control, Expect-CT, Pragma, Prefer, Preference-Applied, Surrogate-Control) have case-insensitive keys.
Similarly, the parameters rule in HTTP (see <xref section="5.6.6" sectionFormat="of" target="HTTP"/>) allows whitespace before the ";" delimiter, but Structured Fields does not.
And, <xref section="5.6.4" sectionFormat="of" target="HTTP"/> allows backslash-escaping most characters in quoted strings, whereas Structured Field Strings only escape "\" and DQUOTE. The vast majority of fields seen in typical traffic do not exhibit these behaviors.</t>
        </dd>
        <dt>Error handling:</dt>
        <dd>
          <t>Parsing algorithms specified (or just widely implemented) for current HTTP headers may differ from those in Structured Fields in details such as error handling. For example, HTTP specifies that repeated directives in the Cache-Control header field have a different precedence than that assigned by a Dictionary structured field (which Cache-Control is mapped to).</t>
        </dd>
        <dt>Token limitations:</dt>
        <dd>
          <t>In Structured Fields, tokens are required to begin with an alphabetic character or "*", whereas HTTP tokens allow a wider range of characters. This prevents use of mapped values that begin with one of these characters. For example, media types, field names, methods, range-units, character and transfer codings that begin with a number or special character other than "*" might be valid HTTP protocol elements, but will not be able to be represented as Structured Field Tokens.</t>
        </dd>
        <dt>Integer limitations:</dt>
        <dd>
          <t>Structured Fields Integers can have at most 15 digits; larger values will not be able to be represented in them.</t>
        </dd>
        <dt>IPv6 Literals:</dt>
        <dd>
          <t>Fields whose values contain IPv6 literal addresses (such as CDN-Loop, Host, and Origin) are not able to be represented as Structured Fields Tokens, because the brackets used to delimit them are not allowed in Tokens.</t>
        </dd>
        <dt>Empty Field Values:</dt>
        <dd>
          <t>Empty and whitespace-only field values are considered errors in Structured Fields. For compatible fields, an empty field indicates that the field should be silently ignored.</t>
        </dd>
        <dt>Alt-Svc:</dt>
        <dd>
          <t>Some ALPN tokens (e.g., <tt>h3-Q43</tt>) do not conform to key's syntax, and therefore cannot be represented as a Token. Since the final version of HTTP/3 uses the <tt>h3</tt> token, this shouldn't be a long-term issue, although future tokens may again violate this assumption.</t>
        </dd>
        <dt>Content-Length:</dt>
        <dd>
          <t>Note that Content-Length is defined as a List because it is not uncommon for implementations to mistakenly send multiple values. See <xref section="8.6" sectionFormat="of" target="HTTP"/> for handling requirements.</t>
        </dd>
        <dt>Retry-After:</dt>
        <dd>
          <t>Only the delta-seconds form of Retry-After can be represented; a Retry-After value containing a http-date will need to be converted into delta-seconds to be conveyed as a Structured Field Value.</t>
        </dd>
      </dl>
    </section>
    <section anchor="mapped">
      <name>Mapped Fields</name>
      <t>Some HTTP field values have syntax that cannot be successfully parsed as Structured Fields. Instead, it is necessary to map them into a separate Structured Field with an alternative name.</t>
      <t>For example, the Date HTTP header field carries a date:</t>
      <sourcecode type="http-message"><![CDATA[
Date: Sun, 06 Nov 1994 08:49:37 GMT
]]></sourcecode>
      <t>Its value would be mapped to:</t>
      <sourcecode type="http-message-new"><![CDATA[
SF-Date: @784111777
]]></sourcecode>
      <t>As in <xref target="compatible"/>, these fields are unable to carry values that are not valid Structured Fields, and so an application using this specification will need to how to support such values. Typically, handling them using the original field name is sufficient.</t>
      <t>Each field name listed below indicates a replacement field name and a means of mapping its original value into a Structured Field.</t>
      <section anchor="urls">
        <name>URLs</name>
        <t>The field names in <xref target="url-fields"/> (paired with their mapped field names) have values that can be mapped into Structured Fields by treating the original field's value as a String.</t>
        <table anchor="url-fields">
          <name>URL Fields</name>
          <thead>
            <tr>
              <th align="left">Field Name</th>
              <th align="left">Mapped Field Name</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">Content-Location</td>
              <td align="left">SF-Content-Location</td>
            </tr>
            <tr>
              <td align="left">Location</td>
              <td align="left">SF-Location</td>
            </tr>
            <tr>
              <td align="left">Referer</td>
              <td align="left">SF-Referer</td>
            </tr>
          </tbody>
        </table>
        <t>For example, this Location field</t>
        <sourcecode type="http-message"><![CDATA[
Location: https://example.com/foo
]]></sourcecode>
        <t>could be mapped as:</t>
        <sourcecode type="http-message"><![CDATA[
SF-Location: "https://example.com/foo"
]]></sourcecode>
      </section>
      <section anchor="dates">
        <name>Dates</name>
        <t>The field names in <xref target="date-fields"/> (paired with their mapped field names) have values that can be mapped into Structured Fields by parsing their payload according to <xref section="5.6.7" sectionFormat="of" target="HTTP"/> and representing the result as a Date.</t>
        <table anchor="date-fields">
          <name>Date Fields</name>
          <thead>
            <tr>
              <th align="left">Field Name</th>
              <th align="left">Mapped Field Name</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">Date</td>
              <td align="left">SF-Date</td>
            </tr>
            <tr>
              <td align="left">Expires</td>
              <td align="left">SF-Expires</td>
            </tr>
            <tr>
              <td align="left">If-Modified-Since</td>
              <td align="left">SF-If-Modified-Since</td>
            </tr>
            <tr>
              <td align="left">If-Unmodified-Since</td>
              <td align="left">SF-If-Unmodified-Since</td>
            </tr>
            <tr>
              <td align="left">Last-Modified</td>
              <td align="left">SF-Last-Modified</td>
            </tr>
          </tbody>
        </table>
        <t>For example, an Expires field could be mapped as:</t>
        <sourcecode type="http-message-new"><![CDATA[
SF-Expires: @1659578233
]]></sourcecode>
      </section>
      <section anchor="etags">
        <name>ETags</name>
        <t>The field value of the ETag header field can be mapped into the SF-ETag Structured Field by representing the entity-tag as a String, and the weakness flag as a Boolean "w" parameter on it, where true indicates that the entity-tag is weak; if 0 or unset, the entity-tag is strong.</t>
        <t>For example, this:</t>
        <sourcecode type="http-message"><![CDATA[
ETag: W/"abcdef"
]]></sourcecode>
        <sourcecode type="http-message"><![CDATA[
SF-ETag: "abcdef"; w
]]></sourcecode>
        <t>If-None-Match's field value can be mapped into the SF-If-None-Match Structured Field, which is a List of the structure described above. When a field value contains "*", it is represented as a Token.</t>
        <t>Likewise, If-Match's field value can be mapped into the SF-If-Match Structured Field in the same manner.</t>
        <t>For example:</t>
        <sourcecode type="http-message"><![CDATA[
SF-If-None-Match: "abcdef"; w, "ghijkl", *
]]></sourcecode>
      </section>
      <section anchor="cookies">
        <name>Cookies</name>
        <t>The field values of the Cookie and Set-Cookie fields <xref target="COOKIES"/> can be mapped into the SF-Cookie Structured Field (a List) and SF-Set-Cookie Structured Field (a List), respectively.</t>
        <t>In each case, a cookie is represented as an Inner List containing two Items; the cookie name and value. The cookie name is always a String; the cookie value is a String, unless it can be successfully parsed as the textual representation of another, bare Item structured type (e.g., Byte Sequence, Decimal, Integer, Token, or Boolean).</t>
        <t>Cookie attributes map to Parameters on the Inner List, with the parameter name being forced to lowercase. Cookie attribute values are Strings unless a specific type is defined for them. This specification defines types for existing cookie attributes in <xref target="cookie-params"/>.</t>
        <table anchor="cookie-params">
          <name>Set-Cookie Parameter Types</name>
          <thead>
            <tr>
              <th align="left">Parameter Name</th>
              <th align="left">Structured Type</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">Domain</td>
              <td align="left">String</td>
            </tr>
            <tr>
              <td align="left">HttpOnly</td>
              <td align="left">Boolean</td>
            </tr>
            <tr>
              <td align="left">Expires</td>
              <td align="left">Date</td>
            </tr>
            <tr>
              <td align="left">Max-Age</td>
              <td align="left">Integer</td>
            </tr>
            <tr>
              <td align="left">Path</td>
              <td align="left">String</td>
            </tr>
            <tr>
              <td align="left">Secure</td>
              <td align="left">Boolean</td>
            </tr>
            <tr>
              <td align="left">SameSite</td>
              <td align="left">Token</td>
            </tr>
          </tbody>
        </table>
        <t>The Expires attribute is mapped to a Date representation of parsed-cookie-date (see <xref section="5.1.1" sectionFormat="of" target="COOKIES"/>).</t>
        <t>For example, these unstructured fields:</t>
        <sourcecode type="http-message"><![CDATA[
Set-Cookie: lang=en-US; Expires=Wed, 09 Jun 2021 10:18:14 GMT;
               samesite=Strict; secure
Cookie: SID=31d4d96e407aad42; lang=en-US
]]></sourcecode>
        <t>can be mapped into:</t>
        <sourcecode type="http-message-new"><![CDATA[
SF-Set-Cookie: ("lang" "en-US"); expires=@1623233894;
               samesite=Strict; secure
SF-Cookie: ("SID" "31d4d96e407aad42"), ("lang" "en-US")
]]></sourcecode>
      </section>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>Please add the following note to the "Hypertext Transfer Protocol (HTTP) Field Name Registry":</t>
      <ul empty="true">
        <li>
          <t>A prefix of "*" in the Structured Type column indicates that it is a retrofit type (i.e., not
natively Structured); see RFC nnnn.</t>
        </li>
      </ul>
      <t>Then, add a new column, "Structured Type", with the values from <xref target="compatible"/> assigned to the nominated registrations, prefixing each with "*" to indicate that it is a retrofit type.</t>
      <t>Then, add the field names in <xref target="new-fields"/>, with the corresponding Structured Type as indicated, a status of "permanent" and referring to this document.</t>
      <table anchor="new-fields">
        <name>New Fields</name>
        <thead>
          <tr>
            <th align="left">Field Name</th>
            <th align="left">Structured Type</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left">SF-Content-Location</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">SF-Cookie</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">SF-Date</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">SF-ETag</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">SF-Expires</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">SF-If-Match</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">SF-If-Modified-Since</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">SF-If-None-Match</td>
            <td align="left">List</td>
          </tr>
          <tr>
            <td align="left">SF-If-Unmodified-Since</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">SF-Last-Modified</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">SF-Location</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">SF-Referer</td>
            <td align="left">Item</td>
          </tr>
          <tr>
            <td align="left">SF-Set-Cookie</td>
            <td align="left">List</td>
          </tr>
        </tbody>
      </table>
      <t>Finally, add a new column to the "Cookie Attribute Registry" established by <xref target="COOKIES"/> with the title "Structured Type", using information from <xref target="cookie-params"/>.</t>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t><xref target="compatible"/> identifies existing HTTP fields that can be parsed and serialised with the algorithms defined in <xref target="STRUCTURED-FIELDS"/>. Variances from existing parser behavior might be exploitable, particularly if they allow an attacker to target one implementation in a chain (e.g., an intermediary). However, given the considerable variance in parsers already deployed, convergence towards a single parsing algorithm is likely to have a net security benefit in the longer term.</t>
      <t><xref target="mapped"/> defines alternative representations of existing fields. Because downstream consumers might interpret the message differently based upon whether they recognise the alternative representation, implementations are prohibited from generating such fields unless they have negotiated support for them with their peer. This specification does not define such a mechanism, but any such definition needs to consider the implications of doing so carefully.</t>
    </section>
  </middle>
  <back>
    <references>
      <name>Normative References</name>
      <reference anchor="RFC2119">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author fullname="S. Bradner" initials="S." surname="Bradner">
            <organization/>
          </author>
          <date month="March" year="1997"/>
          <abstract>
            <t>In many standards track documents several words are used to signify the requirements in the specification.  These words are often capitalized. This document defines these words as they should be interpreted in IETF documents.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="2119"/>
        <seriesInfo name="DOI" value="10.17487/RFC2119"/>
      </reference>
      <reference anchor="HTTP">
        <front>
          <title>HTTP Semantics</title>
          <author fullname="R. Fielding" initials="R." role="editor" surname="Fielding">
            <organization/>
          </author>
          <author fullname="M. Nottingham" initials="M." role="editor" surname="Nottingham">
            <organization/>
          </author>
          <author fullname="J. Reschke" initials="J." role="editor" surname="Reschke">
            <organization/>
          </author>
          <date month="June" year="2022"/>
          <abstract>
            <t>The Hypertext Transfer Protocol (HTTP) is a stateless application-level protocol for distributed, collaborative, hypertext information systems. This document describes the overall architecture of HTTP, establishes common terminology, and defines aspects of the protocol that are shared by all versions. In this definition are core protocol elements, extensibility mechanisms, and the "http" and "https" Uniform Resource Identifier (URI) schemes. </t>
            <t>This document updates RFC 3864 and obsoletes RFCs 2818, 7231, 7232, 7233, 7235, 7538, 7615, 7694, and portions of 7230.</t>
          </abstract>
        </front>
        <seriesInfo name="STD" value="97"/>
        <seriesInfo name="RFC" value="9110"/>
        <seriesInfo name="DOI" value="10.17487/RFC9110"/>
      </reference>
      <reference anchor="STRUCTURED-FIELDS">
        <front>
          <title>Structured Field Values for HTTP</title>
          <author fullname="Mark Nottingham" initials="M." surname="Nottingham">
            <organization>Cloudflare</organization>
          </author>
          <author fullname="Poul-Henning Kamp" initials="P." surname="Kamp">
            <organization>The Varnish Cache Project</organization>
          </author>
          <date day="22" month="December" year="2022"/>
          <abstract>
            <t>   This document describes a set of data types and associated algorithms
   that are intended to make it easier and safer to define and handle
   HTTP header and trailer fields, known as "Structured Fields",
   "Structured Headers", or "Structured Trailers".  It is intended for
   use by specifications of new HTTP fields that wish to use a common
   syntax that is more restrictive than traditional HTTP field values.

   This document obsoletes RFC 8941; Appendix D lists changes.

            </t>
          </abstract>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-sfbis-01"/>
      </reference>
      <reference anchor="COOKIES">
        <front>
          <title>Cookies: HTTP State Management Mechanism</title>
          <author fullname="Steven Bingler" initials="S." surname="Bingler">
            <organization>Google LLC</organization>
          </author>
          <author fullname="Mike West" initials="M." surname="West">
            <organization>Google LLC</organization>
          </author>
          <author fullname="John Wilander" initials="J." surname="Wilander">
            <organization>Apple, Inc</organization>
          </author>
          <date day="7" month="November" year="2022"/>
          <abstract>
            <t>   This document defines the HTTP Cookie and Set-Cookie header fields.
   These header fields can be used by HTTP servers to store state
   (called cookies) at HTTP user agents, letting the servers maintain a
   stateful session over the mostly stateless HTTP protocol.  Although
   cookies have many historical infelicities that degrade their security
   and privacy, the Cookie and Set-Cookie header fields are widely used
   on the Internet.  This document obsoletes RFC 6265.

            </t>
          </abstract>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-rfc6265bis-11"/>
      </reference>
      <reference anchor="RFC8174">
        <front>
          <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
          <author fullname="B. Leiba" initials="B." surname="Leiba">
            <organization/>
          </author>
          <date month="May" year="2017"/>
          <abstract>
            <t>RFC 2119 specifies common key words that may be used in protocol  specifications.  This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the  defined special meanings.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="8174"/>
        <seriesInfo name="DOI" value="10.17487/RFC8174"/>
      </reference>
    </references>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA71c63LbRrL+j6eYw1SdSC6CkmzFF/p4K4oua+3KsmLKcbY2
W5shMCQRgQCCAUTz2M6znGfZJ9uve2ZwIUBZ2h9H5bJIYC7dPX3vHvm+7xVR
EauxeKeKPJ1FhZgUeRkUZa5CcRapONRilubi9fX1lSen01zd3jXWC9MgkUus
F+ZyVviRKmb+oiiyaaT93E7z9596oSww6NPJ0fXpFy/Al3mar8dCF6EncyXH
4ijL4ggvojTRQiYhNpWxfx0tlbdK85t5npbZ2IDlRVk+FgBFF4/391/sP/Zu
1BqDwrEnfCxZwTgzMOIhgeR5usDC/5RxmgCWtdKeXsq8+OfvZVooPRZJ6mXR
WPy9SIOhwH9REqqkGAqd5kWuZhqf1kv7ocijAK+CdJlJ+2GJwXgVJXGUqH94
Hr5GxRowicnpxdlYDN6dHYsEPwPPu1VJqehVEy8hinUGyD4A3yiZiz/TOzxd
pERgQkGP9/bo92o+SvP5Ht4tZRSPRUV2fzX/fvWEXuKdzINFPS+OdKFH5uXe
EV5Ft0rvXZVTkH2vuQAtm6ssrafOo2JRTkfA0e7Ov3z1sVCJpgPbi+VUxXrP
nbhnZviR1qXy+eVYVC89WRaLNKfTwlZCGAZ6I/MbcZkWBVBfyCW/Aagyif6X
uWLMT7IUhxibzwIHe5XLRS4T/h6kZVIQVx2BM3IZR5IfK0OjZZIW39N/o0QV
/KLMoxrH1Wo1cm/3PC9J8yW2veVDwsE9Pjh4QR/poMb04MX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