Advisory Content-Length for HTTP
draft-nottingham-bikeshed-length-00

Document Type Active Internet-Draft (individual)
Last updated 2020-03-17
Stream (None)
Intended RFC status (None)
Formats plain text xml pdf htmlized bibtex
Stream Stream state (No stream defined)
Consensus Boilerplate Unknown
RFC Editor Note (None)
IESG IESG state I-D Exists
Telechat date
Responsible AD (None)
Send notices to (None)
HTTP                                                       M. Nottingham
Internet-Draft                                            March 18, 2020
Intended status: Informational
Expires: September 19, 2020

                    Advisory Content-Length for HTTP
                  draft-nottingham-bikeshed-length-00

Abstract

   The HTTP Content-Length header field is overloaded with (at least)
   two duties: message delimitation in HTTP/1, and metadata about the
   length of an incoming request body to the software handling it.

   This causes confusion, and sometimes problems.  This document
   proposes a new header to untangle these semantics (at least
   partially).

Note to Readers

   _RFC EDITOR: please remove this section before publication_

   The issues list for this draft can be found at
   https://github.com/mnot/I-D/labels/bikeshed-length [1].

   The most recent (often, unpublished) draft is at
   https://mnot.github.io/I-D/bikeshed-length/ [2].

   Recent changes are listed at https://github.com/mnot/I-D/commits/gh-
   pages/bikeshed-length [3].

   See also the draft's current status in the IETF datatracker, at
   https://datatracker.ietf.org/doc/draft-nottingham-bikeshed-length/
   [4].

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at https://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any

Nottingham             Expires September 19, 2020               [Page 1]
Internet-Draft      Advisory Content-Length for HTTP          March 2020

   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on September 19, 2020.

Copyright Notice

   Copyright (c) 2020 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (https://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
     1.1.  Notational Conventions  . . . . . . . . . . . . . . . . .   4
   2.  The Bikeshed-Length HTTP Header Field . . . . . . . . . . . .   4
     2.1.  Example . . . . . . . . . . . . . . . . . . . . . . . . .   5
   3.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   5
   4.  Security Considerations . . . . . . . . . . . . . . . . . . .   5
   5.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   5
     5.1.  Normative References  . . . . . . . . . . . . . . . . . .   5
     5.2.  Informative References  . . . . . . . . . . . . . . . . .   6
     5.3.  URIs  . . . . . . . . . . . . . . . . . . . . . . . . . .   6
   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .   6

1.  Introduction

   The HTTP Content-Length header field ([RFC7230]) is overloaded with
   (at least) two duties: message delimitation in HTTP/1, and metadata
   about the length of an incoming request body to the software handling
   it.

   Message delimitation is a core feature of the protocol; it allows
   more than one message to be sent in a given direction on a
   connection.  It is also security-critical; if it is under attacker
   control, it's possible to confuse a recipient about how requests and
   responses are associated in HTTP/1.1 (as "smuggling" attacks).

Nottingham             Expires September 19, 2020               [Page 2]
Internet-Draft      Advisory Content-Length for HTTP          March 2020

   As such, it has been treated progressively more strictly in HTTP
   specifications.  HTTP/1.1 introduced chunked transfer encoding, and
   forbade sending Content-Length when it is in use.  From [RFC2616]:

      Messages MUST NOT include both a Content-Length header field and a
      non-identity transfer-coding.  If the message does include a non-
      identity transfer-coding, the Content-Length MUST be ignored.

      If a message is received with both a Transfer-Encoding header
      field and a Content-Length header field, the latter MUST be
      ignored.

   [RFC7230] strengthened that to:

      A sender MUST NOT send a Content-Length header field in any
Show full document text