<?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>27797</bug_id>
          
          <creation_ts>2015-01-11 08:58:51 +0000</creation_ts>
          <short_desc>&quot;If init&apos;s statusText member does not match the ...&quot;</short_desc>
          <delta_ts>2015-08-10 15:57:26 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>Fetch</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</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>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jxck">block.rxckin.beats</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>hiroshige</cc>
    
    <cc>mike</cc>
          
          <qa_contact>sideshowbarker+fetchspec</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>116999</commentid>
    <comment_count>0</comment_count>
    <who name="Jxck">block.rxckin.beats</who>
    <bug_when>2015-01-11 08:58:51 +0000</bug_when>
    <thetext>https://fetch.spec.whatwg.org/#response-class

[[
If init&apos;s statusText member does not match the Reason-Phrase token production, throw a TypeError.
]]

Reason-Phrase links to RFC2616.
https://tools.ietf.org/html/rfc2616#section-6.1.1

but 2616 was updated to RFC7231 and there are little diff,
so I think it&apos;s better to link to,
https://tools.ietf.org/html/rfc7231#section-6


p.s.
It&apos;s my first file a bug, sorry for my poor english.

thanks.
Jxck</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117146</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-01-14 10:09:54 +0000</bug_when>
    <thetext>It is defined in https://tools.ietf.org/html/rfc7230#section-3.1.2 as far as I can tell and it looks about the same. Are you sure it&apos;s different?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117148</commentid>
    <comment_count>2</comment_count>
    <who name="Jxck">block.rxckin.beats</who>
    <bug_when>2015-01-14 11:56:04 +0000</bug_when>
    <thetext>diff between 2616 and 7231


-408 Request Time-out
+408 Request Timeout

-413 Request Entity Too Large
+413 Payload Too Large

-414 Request-URI Too Large
+414 URI Too Long

-416 Requested range not satisfiable
+416 Range Not Satisfiable


+426 Upgrade Required


-504 Gateway Time-out
+504 Gateway Timeout

-505 HTTP Version not supported
+505 HTTP Version Not Supported

if this spec says we need to check the reason-phrase based on string equality,
this diffs cause a problem I think.

Jxck</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117149</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-01-14 12:01:26 +0000</bug_when>
    <thetext>Reason-Phrase is a syntax production. We are not checking the actual value, just checking that it matches the syntax. It is perfectly fine to have something like

  Tokyo is pretty great

with any status code as that line matches the Reason-Phrase production.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117151</commentid>
    <comment_count>4</comment_count>
    <who name="Jxck">block.rxckin.beats</who>
    <bug_when>2015-01-14 12:20:35 +0000</bug_when>
    <thetext>ah I misunderstood.

we need to check not the value as string,
but syntax of.

reason-phrase  = *( HTAB / SP / VCHAR / obs-text )

and throw TypeError if not mutched.

I see, thanks :)

Jxck</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>118949</commentid>
    <comment_count>5</comment_count>
    <who name="Hiroshige Hayashizaki">hiroshige</who>
    <bug_when>2015-03-26 09:39:07 +0000</bug_when>
    <thetext>RFC 2616 and RFC 7230 seem slightly different with respect to header values: RFC 7230 clarified that octets &apos;\x00&apos; - &apos;\x1F&apos; and &apos;\x7F&apos; (except for &apos;\t&apos;) cannot appear in the header values even if they are quoted.

Also, octets &apos;\x80&apos; - &apos;\xFF&apos; in header values and Reason-Phrase are obsoleted in RFC 7230 (I&apos;m not sure what to do for obsoleted octets though).

I&apos;m wondering if I can check the inputs against RFC 7230 (https://docs.google.com/document/d/1eH4aQNaYT6PDFugUXfAcgK4J1aU7m-iu9x_YVGsNel4/edit?usp=sharing ).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>118950</commentid>
    <comment_count>6</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-03-26 10:32:31 +0000</bug_when>
    <thetext>Hayashizaki-san, I think the main thing we want to consider here is how we can offer a consistent story between XMLHttpRequest and fetch().

E.g. will Chrome start treating it as a network error if the server returns those bytes? If not, and those bytes are then surfaced by XMLHttpRequest&apos;s statusText, I think we should offer the same features to fetch() and Response. It seems rather weird to fragment the platform rather arbitrarily.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119677</commentid>
    <comment_count>7</comment_count>
    <who name="Hiroshige Hayashizaki">hiroshige</who>
    <bug_when>2015-04-20 10:49:17 +0000</bug_when>
    <thetext>In my understandings, the XHR spec [1] refers to &quot;headers list&quot; [2], not to Headers class.
The checks in Fetch API spec that refer to RFC 2616 applies only to JavaScript interfaces of Fetch API (i.e. Request.headers.append() etc.).

&gt; E.g. will Chrome start treating it as a network error if the server returns those bytes? If not, and those bytes are then surfaced by XMLHttpRequest&apos;s statusText, I think we should offer the same features to fetch() and Response. It seems rather weird to fragment the platform rather arbitrarily.
In this case, those bytes are also surfaced by Fetch API, i.e. by Request.headers returned by fetch(), because the Response object is created by the step:
&gt; Otherwise, resolve p with a new Response object associated with response and a new Headers object whose guard is &quot;immutable&quot;.
where checks in Headers class by RFC 2616/7230 are not applied.
(is my understandings correct?)

If we use RFC 7230 in Fetch API (and not in XHR), some headers can set by XHR&apos;s setRequestHeader(), but cannot set in Fetch&apos;s Request.headers.append().
This is intended for me (to encourage Fetch API&apos;s users to follow the new spec).

[1] https://xhr.spec.whatwg.org/
[2] https://fetch.spec.whatwg.org/#terminology-headers
[3] https://fetch.spec.whatwg.org/#dom-global-fetch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119737</commentid>
    <comment_count>8</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-04-21 22:00:20 +0000</bug_when>
    <thetext>Hmm, I&apos;m not sure that&apos;s desirable since that would mean XMLHttpRequest is more powerful than fetch() for this feature. If anything fetch() needs to be more powerful in the end.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119756</commentid>
    <comment_count>9</comment_count>
    <who name="Hiroshige Hayashizaki">hiroshige</who>
    <bug_when>2015-04-22 16:33:42 +0000</bug_when>
    <thetext>I also noticed XHR spec e.g. setRequestHeader()
https://xhr.spec.whatwg.org/#dom-xmlhttprequest-setrequestheader
refers to Fetch API&apos;s spec&apos;s concept-header-value
https://fetch.spec.whatwg.org/#concept-header-value
that refers to RFC 2616.
So if we change Fetch API&apos;s concept-header-value to refer RFC 7230, then it also affects XHR...
(so my understanding in Comment 7 that we can only modify Fetch API seems wrong)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119912</commentid>
    <comment_count>10</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-04-27 03:32:30 +0000</bug_when>
    <thetext>Right, we can change all APIs. The question is, can we make existing APIs more restrictive? And if we can&apos;t, do we really want newer APIs to be more restrictive as that means developers might resort to using older APIs to work around the gap?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122341</commentid>
    <comment_count>11</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-07-31 12:37:26 +0000</bug_when>
    <thetext>https://github.com/whatwg/fetch/issues/99
https://github.com/w3c/web-platform-tests/pull/2045</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122536</commentid>
    <comment_count>12</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-08-10 15:39:58 +0000</bug_when>
    <thetext>https://github.com/whatwg/fetch/commit/6c00fe28e7a361d2b7e0dda776ebccfaa4c439a5
https://github.com/whatwg/xhr/commit/90c79d0c0a5dff16266c4b6673eca8bb512343f6</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>