<?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>22151</bug_id>
          
          <creation_ts>2013-05-23 10:19:36 +0000</creation_ts>
          <short_desc>Special case cross-origin -&gt; Same origin redirect, omit credentials unless withCredentials is explicitly set to true</short_desc>
          <delta_ts>2013-05-23 10:21:14 +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>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</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="Hallvord R. M. Steen">hsteen</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>mike</cc>
          
          <qa_contact>sideshowbarker+fetchspec</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>88119</commentid>
    <comment_count>0</comment_count>
    <who name="Hallvord R. M. Steen">hsteen</who>
    <bug_when>2013-05-23 10:19:36 +0000</bug_when>
    <thetext>http://fetch.spec.whatwg.org/#basic-fetch

[[
If the CORS flag is set and response&apos;s
     location&apos;s origin is not
     request&apos;s url&apos;s
     origin, set request&apos;s
     origin to a globally unique identifier.
]]

I&apos;m not sure if this is already handled, but as far as I&apos;ve been able to interpret the spec it isn&apos;t fully dealt with:

If a CORS-request is redirected back to a same-origin URL

Request from: www.example.com/foo
Request to: crossorigin.example.com/bar
Redirects to: www.example.com/foo/2

by the above &quot;origin&quot; will be set to a GUID, so the Origin: and Referer: headers will be omitted in the next request. However, cookies and other credentials will be included by default as it is now same-origin as the requesting page?

Any cross-origin -&gt; same origin redirect should make sure the credentials mode stays the same. So for example with XHR, unless withCredentials is explicitly set to true, cookies should be omitted in the new same-origin request.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88120</commentid>
    <comment_count>1</comment_count>
    <who name="Hallvord R. M. Steen">hsteen</who>
    <bug_when>2013-05-23 10:21:14 +0000</bug_when>
    <thetext>So it should be handled because the GUID should not equal the origin of the original page.

(A note to explain this effect would be welcome..)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>