<?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>137865</bug_id>
          
          <creation_ts>2014-10-19 12:19:25 -0700</creation_ts>
          <short_desc>XMLHttpRequest using wrong default content-type, forcing CORS preflight</short_desc>
          <delta_ts>2014-10-21 09:50:28 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>Other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>99973</dup_id>
          
          <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="Chris J. Shull">chrisjshull</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1042694</commentid>
    <comment_count>0</comment_count>
    <who name="Chris J. Shull">chrisjshull</who>
    <bug_when>2014-10-19 12:19:25 -0700</bug_when>
    <thetext>Per http://www.w3.org/TR/XMLHttpRequest2/#the-send-method
When sending a string:
Let mime type be &quot;text/plain;charset=UTF-8&quot;.

Now try this with an HTTP proxy/monitor and Safari 8.0:
var xhr = new XMLHttpRequest();
var url = &quot;http://www.corsproxy.com/en.wikipedia.org/wiki/Http?&quot; + Date.now();
xhr.open(&quot;POST&quot;, url, true);
xhr.send(&quot;test&quot;);

Observed:
An OPTIONS preflight.
Because the Content-Type in the POST request has been set to application/xml.

Expected:
No OPTIONS preflight.
Content-Type in the POST request to be text/plain;charset=UTF-8.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1042695</commentid>
    <comment_count>1</comment_count>
    <who name="Chris J. Shull">chrisjshull</who>
    <bug_when>2014-10-19 12:23:54 -0700</bug_when>
    <thetext>For note, Chrome v38 handles this correctly, as does Forefox v33.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1043092</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2014-10-20 20:59:11 -0700</bug_when>
    <thetext>I think that &quot;text/plain;charset=UTF-8&quot; would also cause preflight, as the implementation stands now.

*** This bug has been marked as a duplicate of bug 99973 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1043144</commentid>
    <comment_count>3</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2014-10-21 01:35:11 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; I think that &quot;text/plain;charset=UTF-8&quot; would also cause preflight, as the
&gt; implementation stands now.

The request should already be considered as simple by the latest webkit revision.
I will double check this and report.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1043205</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2014-10-21 09:50:28 -0700</bug_when>
    <thetext>Yes, looks like I was wrong, it doesn&apos;t cause a preflight any more.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>