Preflight of cross domain Ajax with custom header (using jquery) always getting cancelled -
i trying make cross domain post custom headers, preflight getting cancelled (that's word in chrome's "inspect element" panel >> "network" label), , cannot tell whether cancelled browser or jquery. code is:
var request = $.ajax({ 'type' : 'post', 'crossdomain' : true, 'url' : 'https://host.domain/some_path', 'data' : {'some_key': 'some_value'}, 'headers' : { 'authorization' : 'custom-method credential_id:credential_secret', 'x-some-custom-header' : '2013-05-02' } }) .done(function(blah){blah}) .fail(function(blah){blah});
- if remove headers object, or set {}, request can made successfully.
- if remove authorization header, preflight still cancelled.
i don't think it's server-side issue, because there nothing options request method in server's log. think preflight request never been made.
so, idea?
thanks in advance.
figured out: it's problem credential used in https, nothing codes.
generated server credential myself, need tell browser trust credential.
Comments
Post a Comment