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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>92755</bug_id>
          
          <creation_ts>2012-07-31 07:50:07 -0700</creation_ts>
          <short_desc>CORS handling of 401 response to preflight incorrect (sends the actual POST anyway)</short_desc>
          <delta_ts>2018-12-08 08:09:45 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Page Loading</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc>https://bugzilla.mozilla.org/show_bug.cgi?id=778548</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="Boris Zbarsky">bzbarsky</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>ap</cc>
    
    <cc>rbuis</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>683055</commentid>
    <comment_count>0</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-07-31 07:50:07 -0700</bug_when>
    <thetext>Apparently if a preflight for an XHR POST returns a 401 (due to the site requiring Authorization headers), WebKit will send the main POST anyway, in violation of the spec.  Per spec, non-200 responses to a preflight mean the whole thing should be canceled.

See original report at http://code.google.com/p/chromium/issues/detail?id=139566 and see discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=778548</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>683218</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-07-31 09:58:50 -0700</bug_when>
    <thetext>Looking at public-webapps thread on the topic, there is a reason provided why the CORS draft specification should be changed (IIS with &quot;Classic Application Pool&quot; cannot be configured otherwise), but there is no explanation of why the requirement is necessary.

What is the reason for the requirement to reject non-200 responses? Given that the server sends Access-Control-* response header fields, it&apos;s not clear to me why it&apos;s beneficial.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>683222</commentid>
    <comment_count>2</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-07-31 10:03:18 -0700</bug_when>
    <thetext>&gt; What is the reason for the requirement to reject non-200 responses?

You could consider reading the thread in the mail archives that made the decision to do so...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>683228</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-07-31 10:08:45 -0700</bug_when>
    <thetext>Good to know that it has been discussed. Do you have any pointers to that discussion?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>683236</commentid>
    <comment_count>4</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-07-31 10:18:29 -0700</bug_when>
    <thetext>Not offhand; I&apos;d have to search the archives, just like you...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1486308</commentid>
    <comment_count>5</comment_count>
    <who name="Rob Buis">rbuis</who>
    <bug_when>2018-12-08 08:09:45 -0800</bug_when>
    <thetext>We check that response is 200 in validatePreflightResponse and also pass access-control-preflight-request-invalid-status-400.html and access-control-preflight-request-invalid-status-501.html wpt tests, so I think this can be closed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>