<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>22997</bug_id>
          
          <creation_ts>2013-08-18 02:46:39 +0000</creation_ts>
          <short_desc>Better to have a clear statement: firing error or not, if Event streams doesn&apos;t encode as UTF-8 format.</short_desc>
          <delta_ts>2013-09-12 20:04:52 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>HISTORICAL - Server-Sent Events (editor: Ian Hickson)</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="tinazhao">tina.zhao</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>annevk</cc>
    
    <cc>bugs</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>92229</commentid>
    <comment_count>0</comment_count>
    <who name="tinazhao">tina.zhao</who>
    <bug_when>2013-08-18 02:46:39 +0000</bug_when>
    <thetext>Steps to reproduce:
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36

At present, the implementaion on Chrome and Opera browser is if event streams doesn&apos;t encode as UTF-8, the test case jumps to onerror(). But on Firefox, it only assert unreached instead of firing error.
Better to add a statement to let audience know whether firing error is the expected behavior.

- Test suite: https://github.com/w3c/web-platform-tests/tree/master/eventsource
- Test case: https://github.com/w3c/web-platform-tests/blob/master/eventsource/format-utf-8.htm

Spec Info: Server-Sent Events Candidate Recommendation 11 December 2012  (http://www.w3.org/TR/2012/CR-eventsource-20121211/ ).
Spec Description:
&quot;Event streams in this format must always be encoded as UTF-8.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92231</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-08-18 10:16:19 +0000</bug_when>
    <thetext>The user agent requirements of the specification make it pretty clear there should be no error event and it should just work fine.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92247</commentid>
    <comment_count>2</comment_count>
    <who name="tinazhao">tina.zhao</who>
    <bug_when>2013-08-19 01:03:08 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; The user agent requirements of the specification make it pretty clear there
&gt; should be no error event and it should just work fine.

OK, then if it jumps to onerror(), the implementation is wrong and the test case should be FAIL.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92361</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-08-20 17:52:14 +0000</bug_when>
    <thetext>I don&apos;t understand what part of the spec you think is unclear here. Can you elaborate?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92392</commentid>
    <comment_count>4</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2013-08-20 22:08:02 +0000</bug_when>
    <thetext>https://bugzilla.mozilla.org/show_bug.cgi?id=869878 has some background for this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93308</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-09-12 20:04:37 +0000</bug_when>
    <thetext>The spec says:

#  Event streams in this format must always be encoded as UTF-8.

#  Streams must be decoded using the UTF-8 decode algorithm.

..and of the &quot;charset&quot; parameter:

# The parameter&apos;s value must be &quot;utf-8&quot;. This parameter serves no purpose; it
# is only allowed for compatibility with legacy servers

I don&apos;t really know how else to say this.

Nothing in the spec mentions firing &apos;error&apos; for EventSource if the charset=&quot;&quot; is wrong (not UTF-8). In fact it explicitly says:

# HTTP 200 OK responses with a Content-Type header specifying the type
# text/event-stream, ignoring any MIME type parameters, must be processed
# line by line as described below.

(Notice the part that says &quot;ignoring any MIME type parameters&quot;.)

I&apos;ve added yet more text to the intro, just in case, but...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93309</commentid>
    <comment_count>6</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-09-12 20:04:52 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8178.
Check-in comment: Try to be even clearer...
http://html5.org/tools/web-apps-tracker?from=8177&amp;to=8178</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>