Fix withCredentials on synchronous XHRs.
This commit is contained in:
parent
89a7bf5cbc
commit
388c8b9d1a
@ -46,7 +46,14 @@ $.ajax = (url, callbacks, opts={}) ->
|
|||||||
r.setRequestHeader key, val
|
r.setRequestHeader key, val
|
||||||
$.extend r, callbacks
|
$.extend r, callbacks
|
||||||
$.extend r.upload, upCallbacks
|
$.extend r.upload, upCallbacks
|
||||||
|
try
|
||||||
|
# Firefox throws an error if you try
|
||||||
|
# to set this on a synchronous XHR.
|
||||||
|
# Only cookies from the remote domain
|
||||||
|
# are used in a request withCredentials.
|
||||||
r.withCredentials = cred
|
r.withCredentials = cred
|
||||||
|
catch err
|
||||||
|
# do nothing
|
||||||
r.send form
|
r.send form
|
||||||
r
|
r
|
||||||
$.cache = do ->
|
$.cache = do ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user