<?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>98838</bug_id>
          
          <creation_ts>2012-10-09 18:00:39 -0700</creation_ts>
          <short_desc>XHR CORS on 302 Redirect sets Origin to &quot;null&quot; in request</short_desc>
          <delta_ts>2021-03-03 09:48:21 -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>UNCONFIRMED</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=144817</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=222653</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Terin Stock">terinjokes</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>achristensen</cc>
    
    <cc>ap</cc>
    
    <cc>bbudge</cc>
    
    <cc>beidson</cc>
    
    <cc>brent</cc>
    
    <cc>micahnyc</cc>
    
    <cc>mike</cc>
    
    <cc>webdev</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>738386</commentid>
    <comment_count>0</comment_count>
    <who name="Terin Stock">terinjokes</who>
    <bug_when>2012-10-09 18:00:39 -0700</bug_when>
    <thetext>Chrome Version       : 24.0.1284.2 dev
Safari Version       : 6.0.1 (8536.26.14)
Other browsers tested:
  Add OK or FAIL after other browsers where you have tested this issue:
 Firefox 15.x: OK
         IE 8: OK

What steps will reproduce the problem?
0. Be on one domain (host: http://example.test)
1. Initiate a XHR CORS request to a resource. (host: http://test1.example.org)
2. The resource issues a 302 redirect to another resource on another domain (host: http://test2.example.org)

What is the expected result?
The second request (to test2.example.org) would have set the Origin to &quot;example.test&quot; in the request

What happens instead?
During the second request the Origin is set to &quot;null&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>738401</commentid>
    <comment_count>1</comment_count>
    <who name="Terin Stock">terinjokes</who>
    <bug_when>2012-10-09 18:20:14 -0700</bug_when>
    <thetext>X-Post:
    Safari: rdar://problem/12466595 (http://openradar.appspot.com/radar?id=2135401)
    Chrome: http://openradar.appspot.com/radar?id=2135401</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>841207</commentid>
    <comment_count>2</comment_count>
    <who name="Bill Budge">bbudge</who>
    <bug_when>2013-02-25 12:46:57 -0800</bug_when>
    <thetext>Here is a web page that demonstrates the problem. The second test causes a cross-origin redirect, and the new request has no &apos;Origin&apos; header.

http://origin-a.sigusrone.com/cors-redirect-accept-header</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>857927</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2013-03-18 22:04:42 -0700</bug_when>
    <thetext>See also: bug 112471.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1349648</commentid>
    <comment_count>4</comment_count>
    <who name="Brent Royal-Gordon">brent</who>
    <bug_when>2017-09-15 23:51:45 -0700</bug_when>
    <thetext>I&apos;ve experienced this behavior with a 303 redirect as well. My site was using the S3 &quot;Browser-Based Uploads Using POST&quot; feature, which can optionally emit a 303 redirect once the upload is complete.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1349935</commentid>
    <comment_count>5</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2017-09-18 09:34:19 -0700</bug_when>
    <thetext>http://origin-a.sigusrone.com/cors-redirect-accept-header is now working properly.

Brent, have you tried recent Safari versions, like Safari Tech Preview?
Would you be able to provide a reduced test case?</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>