Subject: [hybi] Sec-WebSocket-Extensions field spec. contradiction

From: Sylvain Hellegouarch <[email-masked]>
Date: Sat, 3 Sep 2011 16:25:33 +0200

Hi all,

Section 4.2.2 says:

If multiple extensions are to be used, they must all be listed in a single
> Sec-WebSocket-Extensions header field.  This header field MUST NOT be
> repeated.

But section 9.1 says:

Note that like other HTTP header fields, this header field MAY be split or
> combined across multiple lines.  Ergo, the following are equivalent:
>         Sec-WebSocket-Extensions: foo
>         Sec-WebSocket-Extensions: bar; baz=2
> is exactly equivalent to
>         Sec-WebSocket-Extensions: foo, bar; baz=2

Aren't those two statements contradicting themselves?

--
- Sylvain
http://www.defuze.org
http://twitter.com/lawouach

---

From: Iñaki Baz Castillo <[email-masked]>
Date: Sat, 3 Sep 2011 20:34:31 +0200

> Aren't those two statements contradicting themselves?

Good point. Also, why couldn't such a header occur multiple times in a
HTTP request/response? Usually, any HTTP header allowing multivalue
(separated by comma) also allows different values across multiple
headers, so:

  Foo: qwe, asd
  Foo:  zxc

is the same as:

  Foo: qwe, asd, zxc

This is true for most of the HTTP headers and parsers MUST be ready
for that. Please, don't add artificial constraints.

-- 
Iñaki Baz Castillo
<[email-masked]>

---

From: Alexey Melnikov <[email-masked]>
Date: Tue, 06 Sep 2011 22:56:41 +0100

>>Aren't those two statements contradicting themselves?
Yes, this is a bug.

>for that. Please, don't add artificial constraints.
Any other comments on this? I will implement this change unless there 
are some objections.

---

From: "Richard L. Barnes" <[email-masked]>
Date: Tue, 6 Sep 2011 18:08:28 -0400

On Sep 6, 2011, at 5:56 PM, Alexey Melnikov wrote:

> Any other comments on this? I will implement this change unless there are some objections.

+1 to Iñaki.  Don't see any reason this should be different than any other header field.

--Richard

---

From: Takeshi Yoshino <[email-masked]>
Date: Wed, 7 Sep 2011 14:23:27 +0900

> >>>> Sec-WebSocket-Extensions header field.  This header field MUST NOT be

I agree with Iñaki's suggestion, too.
+1 for removing this statement

---

From: Alexey Melnikov <[email-masked]>
Date: Thu, 08 Sep 2011 00:38:46 +0100

>for that. Please, don't add artificial constraints.
Done in my copy.

Should we do the same for Sec-WebSocket-Protocol and possibly 
Sec-WebSocket-Version (on failure)?

---

From: Iñaki Baz Castillo <[email-masked]>
Date: Thu, 8 Sep 2011 11:19:21 +0200

> Sec-WebSocket-Version (on failure)?

Ir depends on how the spec defines the syntax for those headers. But
usually, any header allowing multiple values separated by comma should
also allow N headers with same header name.

So in the case of Sec-WebSocket-Protocol IMHO it should allow it.

-- 
Iñaki Baz Castillo
<[email-masked]>

---

From: Iñaki Baz Castillo <[email-masked]>
Date: Thu, 8 Sep 2011 11:20:20 +0200

> So in the case of Sec-WebSocket-Protocol IMHO it should allow it.

At least my WS server already allows that :)

-- 
Iñaki Baz Castillo
<[email-masked]>