<?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>28117</bug_id>
          
          <creation_ts>2015-03-01 03:58:58 +0000</creation_ts>
          <short_desc>Clarify timeout in case Preflighted CORS requests</short_desc>
          <delta_ts>2017-03-09 14:02:54 +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>XHR</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</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="Naren">naren</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>bugs</cc>
    
    <cc>jonas</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
    
    <cc>tyoshino</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>118215</commentid>
    <comment_count>0</comment_count>
    <who name="Naren">naren</who>
    <bug_when>2015-03-01 03:58:58 +0000</bug_when>
    <thetext>The spec needs to specify how timeout should behave when there is Preflight OPTIONS request. It seemed logical to assume xhr.timeout = timeout (OPTIONS + ACTUAL) request

The way browsers implement is non intuitive. Say I set timeout as 1000 (1sec). The browser sets 1000ms timeout for OPTIONS and 1000ms timeout for ACTUAL request. 

Clarifying that in the spec would enable browsers to implement the right way.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>118219</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-03-01 08:24:55 +0000</bug_when>
    <thetext>It seems what browsers are doing here does violate the specification as written. I wonder if a redirect resets the timeout as well...

On a different note, could you perhaps indicate whether https://lists.w3.org/Archives/Public/public-webapps/2015JanMar/thread.html#msg646 would be of any help? (Caching of CORS preflights for an entire origin when no credentials are involved.) It&apos;s pretty hard to get feedback from users of CORS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>118227</commentid>
    <comment_count>2</comment_count>
    <who name="Naren">naren</who>
    <bug_when>2015-03-01 19:35:52 +0000</bug_when>
    <thetext>(In reply to Anne from comment #1)
&gt; It seems what browsers are doing here does violate the specification as
&gt; written. I wonder if a redirect resets the timeout as well...

You guessed it right. Redirect does reset the timeout.

&gt; 
&gt; On a different note, could you perhaps indicate whether
&gt; https://lists.w3.org/Archives/Public/public-webapps/2015JanMar/thread.
&gt; html#msg646 would be of any help? (Caching of CORS preflights for an entire
&gt; origin when no credentials are involved.) It&apos;s pretty hard to get feedback
&gt; from users of CORS.


Caching of CORS preflight even for a single resource will improve performance by a great deal. Some of the use cases are posting data to a log server or sending resumable /chunked uploads to say Google cloud storage or Amazon S3. 

Your proposal on caching for entire origin is a great idea. But I have to agree with Brad (https://lists.w3.org/Archives/Public/public-webapps/2015JanMar/0650.html)
especially this part:
On disadvantages of headers:
1) Individual resources declaring policy for an entire origin can be
problematic and difficult to manage.

I will give some more thought and comment on your CORS performance thread.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128477</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2017-03-09 14:02:54 +0000</bug_when>
    <thetext>I realize it&apos;s been two years, but I finally created tests for this and they show that the problem does not appear for redirects, just CORS preflights and only in Chrome: https://github.com/w3c/web-platform-tests/pull/5104.

I&apos;m going to close this bug as this is not a problem with the standard. I&apos;ll also file a bug on Chrome.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>