remove the OPTIONS CORS call
https://github.com/algolia/algoliasearch-client-js/commit/f97236b1d2183a2b4d478469bdf22ddb81d4e8ec commit reverted the setting of custom request headers because it didn't stop the OPTIONS request for CORS.
It mentions the request being POST still demands a OPTIONS request.
I found that if you set the Content-Type to: application/x-www-form-urlencoded and no custom headers you skip the OPTIONS request.
Try my version: http://directlyrics.com/algolia/ac.html
Sorry for the late answer, you are right about the OPTIONS request. We will remove it in our next release of JS API client to improve performance
@ymschaap This was solved in a06c2716760cace47ddc331694476625dc3dbbe2.
Latest release have this fix in, https://cdnjs.com/libraries/algoliasearch
Latest version is again sending the OPTION query -> looks like the content-type is not anymore set to application/x-www-form-urlencoded from the browser.
Where do you see it? Cannot reproduce
Ok seems to be only the angularjs build that is bugged with this, will solve tomorrow morning.
Solving.. Found a clear reference on simple requests: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Simple_requests