title: Access-Control-Allow-Origin / Plupload HTML5 / Cross-Domain / DMcloud
body: <p>I'm implementing a video website with <a href="http://www.dmcloud.net/" rel="nofollow noreferrer">Dailymotion Cloud</a> and <a href="http://www.plupload.com/" rel="nofollow noreferrer">plupload</a> (HTML5 runtime).</p>
  
  <p>The workflow is :</p>
  
  <ol>
  <li><p>Retrieve upload URL via dmcloud API</p></li>
  <li><p>POST file to this URL</p></li>
  <li><p>Retrieve the JSON data in response in order to display the video</p></li>
  </ol>
  
  <p>I'm issuing the following on the upload : <code>xmlhttprequest cannot load origin http://localhost:3000 is not allowed by access-control-allow-origin</code></p>
  
  <p>My issue is that the upload fails with some upload URLs, in a non-deterministic way. When an upload URL works, it works as many times as I want, and when an upload URL doesn't, it never works.</p>
  
  <p>The Dmcloud server sends the <code>Access-Control-Allow-Origin: *</code>.
  Each request is done in two times : first an <code>OPTION</code> request is sent to ensure that the URL is accepting origin. And then a <code>POST</code> request is done.</p>
  
  <p><code>OPTION</code> requests ever successed, with good headers, the issue is coming at the end of the <code>POST</code> request...</p>
  
  <p>Do you think that it is a Dmcloud server issue ? A chrome HTML5 issue ? A plupload issue ?</p>
  
  <p>Some network screenshots :</p>
  
  <p><strong>Success: OPTIONS request</strong>
  <img src="https://i.stack.imgur.com/o2ozu.png" alt="Success: OPTIONS request"></p>
  
  <p><strong>Success: POST request</strong>
  <img src="https://i.stack.imgur.com/tfHMt.png" alt="Success: POST request"></p>
  
  <p><strong>Fail: OPTIONS request</strong>
  <img src="https://i.stack.imgur.com/VJEg0.png" alt="Fail: OPTIONS request"></p>
  
  <p><strong>Fail: POST request</strong>
  <img src="https://i.stack.imgur.com/KL5MB.png" alt="Fail: POST request"></p>