Closed sgarbesi closed 9 years ago
I can't see the proxy file in your example?
@jpillora Even without the proxy it shouldn't force the options request?
Confirmed this is a bug, though it's not with XDomain, it's with XHook. Still not sure why it's happening.
Created smaller example here http://plnkr.co/edit/5qtYBpBE4GEJlViL6iCH?p=preview
This issue is causing some requests to fail with a CORS error on firefox. For instance, querying the geonames api fails even though the preflight returns a 200. You can try it simply by replacing the url in your plnkr to use any of geonames api. The same request works fine on chrome.
@kawazoe As a personal solution, I simply excluded the library unless the browser <= IE9
Thanks for the awesome work on xdomain/xhook, @jpillora.
We are seeing this preflighting issue, too. In our case, we xdomain/xhook is forcing preflighting for the two calls to api.segment.io
. When removing xdomain from the page, the calls complete as simple POST
s.
cc @aseemk @tarajane @gasi
Finally found the time to track down this bug, adding a upload progress listener xhr.upload.onload = function() {};
always causes an OPTIONS for some reason... So to fix it, I'll just proxy those events which have listeners. Fix should land soon
Please see this plnkr example:
http://plnkr.co/edit/9YfiPAKo0yagfLhYRmSu
If you remove the
<script>
include for the xdomain.js library there's no preflight OPTIONS request necessary. Something with the library is triggering/enforcing it, even when it's not needed.