Skip to content

JS client with $.ajaxSetup userDefined setting e.g. { processData: false } which can cause SignalR ajaxSend work unexpectedly #2511

Closed
halter73 opened this Issue Sep 5, 2013 · 1 comment

3 participants

@halter73
SignalR member
halter73 commented Sep 5, 2013

Functional impact:
JS client with $.ajaxSetup userDefined setting e.g. { processData: false } which can cause SignalR ajaxSend work unexpectedly.

Here is the list of common options which can cause SignalR to break:

$.ajaxSetup({ timeout: 1 });

$.ajaxSetup({ processData: false });

$.ajaxSetup({ async: false });

We should specify these setting e.g. { processData: true} in SignalR ajaxSend function

doc for http://api.jquery.com/jQuery.ajax/

Repro:
1).you can use AspNet.Samples,
2). in Raw/Default.aspx, add in script

$.ajaxSetup({ processData: false }); 

3) request the page using longPolling or foreverFrame or serverSentEvents transport
4) click Broadcast button

Expected result:
SignalR still work

Actual result:
you can see that send request body become [object Object], and then its response return error

#1773

@NTaylorMullen NTaylorMullen added a commit that referenced this issue Sep 19, 2013
@NTaylorMullen NTaylorMullen Added ajax defaults that are used to override any default ajax setups…
… to prevent our ajax communications from failing.

#2511
7c94aa5
@NTaylorMullen NTaylorMullen added a commit that referenced this issue Sep 20, 2013
@NTaylorMullen NTaylorMullen Added ajax defaults that are used to override any default ajax setups…
… to prevent our ajax communications from failing.

#2511
e3ffaf1
@gustavo-armenta

tested repro

Repro:
1).you can use AspNet.Samples,
2). in Raw/Default.aspx, add in script
$.ajaxSetup({ processData: false });
3) request the page using longPolling or foreverFrame or serverSentEvents transport
4) click Broadcast button

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.