W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2010

[whatwg] Server-Sent Events parsing issue

From: Anne van Kesteren <annevk@opera.com>
Date: Wed, 13 Oct 2010 16:00:34 +0200
Message-ID: <op.vkio67kx64w2qv@anne-van-kesterens-macbook-pro.local>
On Tue, 12 Oct 2010 06:41:59 +0200, ATSUSHI TAKAYAMA  
<taka.atsushi at googlemail.com> wrote:
> It's a minor error in the spec in the Server-Sent Events spec.
> http://dev.w3.org/html5/eventsource/#event-stream-interpretation
>
> When processing a line with only "data:", the data buffer will be the
> empty string and the LF character added at the "process the field"
> stage. When dispatching the event, the first step "If the data buffer
> is an empty string, set the data buffer and the event name buffer to
> the empty string and abort these steps." does not apply here (since we
> have the LF character, which will be removed in the step 2). So it
> does fire a MessageEvent with an empty string as the data property.
>
> I think the steps 1 and 2 of the dispatching should be the other way  
> round.

Why would we not want to dispatch an event where data is the empty string  
in this case? I do not think this is an error. (Although admittedly I once  
thought it was.)


-- 
Anne van Kesteren
http://annevankesteren.nl/
Received on Wednesday, 13 October 2010 07:00:34 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:01 UTC