Re: #407: draft-ietf-httpbis-p5-range-21, "3.2 416 Requested Range Not Satisfiable"

Mark Nottingham <mnot@mnot.net> Thu, 24 January 2013 01:17 UTC

Return-Path: <ietf-http-wg-request@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1F47E21F85AD for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 23 Jan 2013 17:17:09 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.653
X-Spam-Level:
X-Spam-Status: No, score=-9.653 tagged_above=-999 required=5 tests=[AWL=0.946, BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Z+ljkz81KMxD for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 23 Jan 2013 17:17:08 -0800 (PST)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id D439621F8430 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Wed, 23 Jan 2013 17:17:07 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1TyBPk-0002gs-8p for ietf-http-wg-dist@listhub.w3.org; Thu, 24 Jan 2013 01:15:36 +0000
Resent-Date: Thu, 24 Jan 2013 01:15:36 +0000
Resent-Message-Id: <E1TyBPk-0002gs-8p@frink.w3.org>
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <mnot@mnot.net>) id 1TyBPL-00028W-Lq for ietf-http-wg@listhub.w3.org; Thu, 24 Jan 2013 01:15:11 +0000
Received: from mxout-07.mxes.net ([216.86.168.182]) by maggie.w3.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from <mnot@mnot.net>) id 1TyBPI-0006pC-VI; Thu, 24 Jan 2013 01:15:11 +0000
Received: from [192.168.1.80] (unknown [118.209.240.13]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id CF8B522E1FA; Wed, 23 Jan 2013 20:14:44 -0500 (EST)
Content-Type: text/plain; charset="windows-1252"
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: Mark Nottingham <mnot@mnot.net>
In-Reply-To: <alpine.DEB.1.10.1301070537180.16025@wnl.j3.bet>
Date: Thu, 24 Jan 2013 12:14:38 +1100
Cc: Julian Reschke <julian.reschke@gmx.de>, ietf-http-wg@w3.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <FA42CDF7-B411-4A6B-B5B8-FF653C60FF17@mnot.net>
References: <5087DD2F.7000303@gmx.de> <14525785-453B-4F7A-8803-2475FADA28DD@mnot.net> <alpine.DEB.1.10.1301070537180.16025@wnl.j3.bet>
To: Yves Lafon <ylafon@w3.org>
X-Mailer: Apple Mail (2.1499)
Received-SPF: pass client-ip=216.86.168.182; envelope-from=mnot@mnot.net; helo=mxout-07.mxes.net
X-W3C-Hub-Spam-Status: No, score=-3.3
X-W3C-Hub-Spam-Report: AWL=-3.313, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001
X-W3C-Scan-Sig: maggie.w3.org 1TyBPI-0006pC-VI d0380eb62701b90ad69f9cdfcf3101cb
X-Original-To: ietf-http-wg@w3.org
Subject: Re: #407: draft-ietf-httpbis-p5-range-21, "3.2 416 Requested Range Not Satisfiable"
Archived-At: <http://www.w3.org/mid/FA42CDF7-B411-4A6B-B5B8-FF653C60FF17@mnot.net>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/16135
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

Digging this up...

On 07/01/2013, at 9:53 PM, Yves Lafon <ylafon@w3.org> wrote:

> On Thu, 15 Nov 2012, Mark Nottingham wrote:
> 
>> Now <http://trac.tools.ietf.org/wg/httpbis/trac/ticket/407>
>> 
>> On 24/10/2012, at 11:21 PM, Julian Reschke <julian.reschke@gmx.de> wrote:
>> 
>>> <http://greenbytes.de/tech/webdav/draft-ietf-httpbis-p5-range-21.html#status.416>:
>>> 
>>> "When this status code is returned for a byte-range request, the response SHOULD include a Content-Range header field specifying the current length of the representation (see Section 5.2). This response MUST NOT use the multipart/byteranges content-type. For example,"
>>> 
>>> What is this "MUST NOT" about? Are there clients that will ignore the status code and assume success if they see the expected content-type?
> 
> If a multipart/byteranges can be sent in response to a 416, it can also be send in response to a 200, or to a 206.
> In the case of a 206, you will have a Content-Range in the response and in the multipart/byteranges package, so it will be a partial response of a partial response without asking for it. (the restriction is also there for 206, see discussion around #405).


Why is this a problem? If the 200 response is:

HTTP/1.1 200 OK
Date: Tue, 14 Nov 1995 06:25:24 GMT
Last-Modified: Tue, 14 July 04:58:08 GMT
Content-Length: 2048
Content-Type: multipart-byteranges; boundary=ORIGINAL_BOUNDARY

then the single-range 206 would be something like:

HTTP/1.1 206 Partial Content
Date: Tue, 14 Nov 1995 06:25:24 GMT
Last-Modified: Tue, 14 July 04:58:08 GMT
Content-Range: bytes 1024-2048/2048
Content-Length: 1024
Content-Type: multipart-byteranges; boundary=ORIGINAL_BOUNDARY

while the multi-part 206 would be:

HTTP/1.1 206 Partial Content
Date: Tue, 14 Nov 1995 06:25:24 GMT
Last-Modified: Tue, 14 July 04:58:08 GMT
Content-Length: 449
Content-Type: multipart/byteranges; boundary=OUTER_BOUNDARY

--OUTER_BOUNDARY
Content-Type: multipart-byteranges; boundary=ORIGINAL_BOUNDARY
Content-Range: bytes 3-10/2048

...the first range...
--OUTER_BOUNDARY
Content-Type: video/example
Content-Range: bytes 400-500/2048

...the second range
--OUTER_BOUNDARY--

Note that p5-latest says:

> When a 206 response is generated, the sender must generate the following header fields:
> 
> 	• Either a Content-Range header field (Section 4.2) indicating the single range included with this response, or a multipart/byteranges Content-Type indicating that multiple ranges are enclosed as multipart body-parts.


... which gives clients enough information to determine what kind of response the 206 is.

So, while it's a pathological case, I believe that as long as the recipient dispatches correctly, you can transfer multipart/byteranges just as if it were any other media type on the Web.

Also, I note that Roy removed this requirement in <http://trac.tools.ietf.org/wg/httpbis/trac/changeset/2066>. So, I'm going to mark this issue as 'incorporated' for now; if we find that it needs to change, we can reopen (since that state is just a note that an editor has incorporated a proposed fix for the issue).

Regards,

--
Mark Nottingham   http://www.mnot.net/