[Mono-list] JQuery
Simon Lindgren
simon.n.lindgren at gmail.com
Sun Aug 28 10:12:18 EDT 2011
sön 2011-08-28 klockan 21:40 +1000 skrev jupiter.hce at gmail.com:
> It was a simple test running javascript on client web browser to a web server
> running on Apache & mono (with xsp and mon-mono) on CentOS 5.
>
> The javascript called:
>
> $.ajax({
> url: myUrl,
> data: dataString,
> dataType: "json",
> success: goodCallBack,
> error: errorCallback
> });
>
> If the dataString contained "&" for example dataString = "broken&data" or
> if the dataString contained an empty string dataString = "", the web
> server would treat the dataString as a undefined object and the errorCallback
> would be called.
What is the error, do you get a stacktrace or a generic HTTP 5xx from
apache?
>
> The same dataString would be OK if it sends to a Windows web server
> running on ASP .Net.
Are you using ASP.Net WebForms, ASP.Net MVC, Castle MonoRail, or
something else?
>
> If the dataString contained a space character, the Linux web server
> replaced the space character by "+" but the Windows web server still
> took it as a space character.
>
This might be because (for some reason) the url is not being decoded
correctly. See for example
http://msdn.microsoft.com/en-us/library/4fkewx0t.aspx which describes
the reason for url encoding briefly.
Since you are using a GET request, Url encoding is definitely necessary,
but if decoding is not done spaces will end up being replaced by +
characters. This should most definitely work though.
> If the dataString contained "=' character, the Linux web server would cut
> the string "=" and any characters after the "=", the windows server was
> fine.
>
If url encoding was the issue I would expect strings containing
ampersands rather than '=' to be the issue, and I would expect the
string to be truncated instead of causing an error.
> Also, if I open several client browsers to send dataString every
> second to the same web server, the Linux web server would stop the
> process after 20 minutes, but there was no problem on Windows server.
>
In that case, I don't think this is only one issue.
--
Simon Lindgren
More information about the Mono-list
mailing list