WGLC p1: proxy handling of a really bad Content-Length

Alex Rousskov <rousskov@measurement-factory.com> Wed, 01 May 2013 06:45 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 []) by ietfa.amsl.com (Postfix) with ESMTP id 30C6E21F8C69 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 30 Apr 2013 23:45:09 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -10.566
X-Spam-Status: No, score=-10.566 tagged_above=-999 required=5 tests=[AWL=0.033, BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([]) by localhost (ietfa.amsl.com []) (amavisd-new, port 10024) with ESMTP id jmWJv3kkUZB2 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 30 Apr 2013 23:45:02 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org []) by ietfa.amsl.com (Postfix) with ESMTP id D66C721F8C35 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 30 Apr 2013 23:45:02 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1UXQll-0007lH-1o for ietf-http-wg-dist@listhub.w3.org; Wed, 01 May 2013 06:44:01 +0000
Resent-Date: Wed, 01 May 2013 06:44:01 +0000
Resent-Message-Id: <E1UXQll-0007lH-1o@frink.w3.org>
Received: from lisa.w3.org ([]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <rousskov@measurement-factory.com>) id 1UXQlY-0007g3-RZ for ietf-http-wg@listhub.w3.org; Wed, 01 May 2013 06:43:48 +0000
Received: from measurement-factory.com ([]) by lisa.w3.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from <rousskov@measurement-factory.com>) id 1UXQlY-0005Ha-8z for ietf-http-wg@w3.org; Wed, 01 May 2013 06:43:48 +0000
Received: from [] (localhost []) (authenticated bits=0) by measurement-factory.com (8.14.3/8.14.3) with ESMTP id r416hMKi079938 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 1 May 2013 00:43:24 -0600 (MDT) (envelope-from rousskov@measurement-factory.com)
Message-ID: <5180B982.9050003@measurement-factory.com>
Date: Wed, 01 May 2013 00:43:14 -0600
From: Alex Rousskov <rousskov@measurement-factory.com>
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130329 Thunderbird/17.0.5
MIME-Version: 1.0
To: HTTP Working Group <ietf-http-wg@w3.org>
CC: Mark Nottingham <mnot@mnot.net>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=; envelope-from=rousskov@measurement-factory.com; helo=measurement-factory.com
X-W3C-Hub-Spam-Status: No, score=-2.5
X-W3C-Hub-Spam-Report: RP_MATCHES_RCVD=-2.509, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001
X-W3C-Scan-Sig: lisa.w3.org 1UXQlY-0005Ha-8z 764fd637a5454c21a6edb2024a23761e
X-Original-To: ietf-http-wg@w3.org
Subject: WGLC p1: proxy handling of a really bad Content-Length
Archived-At: <http://www.w3.org/mid/5180B982.9050003@measurement-factory.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/17747
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>


    When talking about dealing with malformed responses, HTTPbis p1
Section 3.3.3 says:

> the proxy MUST discard the received response, send a 502 (Bad
> Gateway) status code as its downstream response, and then close the
> connection.

Which connection MUST the proxy close: upstream or downstream? If you
guessed downstream because the connection must be closed only _after_
the 502 downstream response is sent, you guessed wrong :-).

The proxy MUST close the upstream connection and it may do that
immediately, without waiting for the 502 response to be sent on the
downstream connection. This was discussed around 2011/11/28, and I think
Mark agreed that a fix is needed but the text was never changed.

Also, the current wording suggests sending "status code" as a response,
which is not the intent, of course.

Suggested fix:

  the proxy MUST close the upstream connection, discard the received
  response, and send a 502 (Bad Gateway) response downstream.

Thank you,