Re: [hybi] extension params (was draft-10 questions)

Julian Reschke <julian.reschke@gmx.de> Sat, 03 September 2011 10:54 UTC

Return-Path: <julian.reschke@gmx.de>
X-Original-To: hybi@ietfa.amsl.com
Delivered-To: hybi@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2199321F8C66 for <hybi@ietfa.amsl.com>; Sat, 3 Sep 2011 03:54:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -104.238
X-Spam-Level:
X-Spam-Status: No, score=-104.238 tagged_above=-999 required=5 tests=[AWL=-1.639, BAYES_00=-2.599, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EcREP-3xi4pB for <hybi@ietfa.amsl.com>; Sat, 3 Sep 2011 03:54:27 -0700 (PDT)
Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.22]) by ietfa.amsl.com (Postfix) with SMTP id 1D4A321F8BE8 for <hybi@ietf.org>; Sat, 3 Sep 2011 03:54:26 -0700 (PDT)
Received: (qmail invoked by alias); 03 Sep 2011 10:56:03 -0000
Received: from p508FA108.dip.t-dialin.net (EHLO [192.168.178.36]) [80.143.161.8] by mail.gmx.net (mp066) with SMTP; 03 Sep 2011 12:56:03 +0200
X-Authenticated: #1915285
X-Provags-ID: V01U2FsdGVkX189isgevtg9Wqb9/wAPu4MPLeDS2MXjw/J/7cpDts 4f9CzfOQxYaEIF
Message-ID: <4E6207C2.6040807@gmx.de>
Date: Sat, 03 Sep 2011 12:56:02 +0200
From: Julian Reschke <julian.reschke@gmx.de>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.1) Gecko/20110830 Thunderbird/6.0.1
MIME-Version: 1.0
To: hybi@ietf.org
References: <CAMY5452DoLdw_znttJ_quntoGwK8RdTMF3QoE_kU8k81DveLiw@mail.gmail.com> <4E366369.6050706@gmx.de>
In-Reply-To: <4E366369.6050706@gmx.de>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
Subject: Re: [hybi] extension params (was draft-10 questions)
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/hybi>, <mailto:hybi-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/hybi>
List-Post: <mailto:hybi@ietf.org>
List-Help: <mailto:hybi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 03 Sep 2011 10:54:28 -0000

On 2011-08-01 10:27, Julian Reschke wrote:
> On 2011-08-01 02:23, Brodie Thiesfield wrote:
>> All,
>>
>> During the recent IETF meeting the format of the websocket extension
>> header parameters was brought up. The issue being should the header
>> follow the rules of HTTP (allowing quoted strings) or the simplified
>> rules of websocket draft (allowing only tokens).
>
> Yes. In value parameters.
>
> That's not a strict HTTP rule, but doing so would help reusing existing
> parsers.
>
>> ...
>> Since a websocket connection is plain HTTP prior to upgrade, then a
>> server supporting normal HTTP requests on a connection (i.e. not a WS
>> specific server) will already be using its full HTTP parser.
>>
>> It is not possible to determine what is a WS upgrade message until the
>> headers have already been parsed, e.g. the following message is a
>> valid upgrade but that is not known until the last byte is parsed.
>> Additionally, take away the "Upgrade" header from the end and it is a
>> plain HTTP GET with some unnecessary headers.
>>
>> GET /chat HTTP/1.1
>> Host: server.example.com
>> Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
>> Sec-WebSocket-Origin: http://example.com
>> Sec-WebSocket-Protocol: chat, superchat
>> Sec-WebSocket-Version: 8
>> Connection: Upgrade
>> Upgrade: websocket
>>
>> The WS headers have already been parsed by the HTTP parser. Unless the
>> special parsing of the Sec-Websocket-Extension depends solely on the
>> header key, there can be no special parsing. If it does depend on the
>> header key, then won't this require a change to the HTTP spec to
>> introduce the rule that this header key is parsed specially? If it was
>> so defined, then every header key of every HTTP message will need to
>> be examined to see if it requires the simplified parsing.
>  > ...
>
> It does not depend on the header name; if it did it wouldn't be
> implementable at all.
>
> The concern is just that if we do not allow
>
> Sec-WebSocket-Extensions: bar; baz="2"
>
> in addition to
>
> Sec-WebSocket-Extensions: bar; baz=2
>
> then there's a risk of some implementations re-using parser code,
> accepting the latter form, and some not doing so, creating interop
> problems.
>
> SO far I haven't heard back from Ian (who apparently talked to the other
> Ian), but I think it was mentioned in the session that this does affect
> the API. It does not.
> ...

It would be nice to finally get feedback on this one.

Best regards, Julian