On Fri, Jan 25, 2013 at 11:42 AM, Sergio Sánchez Maffet
<s.sanc...@gmx.net>wrote:
> Hi Derrell,
>
> Yes sure, It is a good idea to keep the jsonp transport generic.
> IMHO this is in this case best achieved by not modifying the server answer
> at all.
> So whatever the server sends back to the client, the client has to deal
> with it.
> The problem is, that we are not sending pure json in jsonp, in fact we are
> sending javascript that will be processed by the browser using the script
> element.
>
> In my opinion, because the data send back is processed by the script
> element already, no additional parsing should be done.
> The qx framework should really not take care here, it should pass the
> content without any further checking.
> This would mean, in this special case, two possible server responses:
>
> a) someCallback({ ... mydate: new Date ...});
> or
> b) someCallback({ ... mydate: "...});
>
> Which would be both valid depending on the client.
>
I am a strong believer in "be liberal in what you accept, be strict in what
you send." Therefore, if we have a way to parse what the server sends and
do something reasonable with it, I would propose that we try to do so. On
the other hand...
> The client to server sending part of the transport is quit similar,
> whatever the client sends, the server needs to deal with it.
> Because Script-Transport does not allow to send anything but a query
> string, no conversion to any json is needed.
> In fact Script-Transport and jsonp never uses the JSON build in object,
> only the sanitize code does... and it is wrong and useless in my opinion.
>
We are sending JSONP, which requires JSON, which does not allow that funky
new Date() stuff that we'd added. Therefore by the "be strict in what you
send" principle, we should never allow sending that, and flag an error to
the user who tries to do so. We should never send anything that does not
strictly conform to the standard.
My thoughts, anyway.
> Should I file a bug? My solution was simply to remove this sanitize code
> in my qx 2.1 version.
>
Feel free to do so. The core team will then look at it and make a decision.
You should probably include a link to this email thread in the bug report,
for the benefit of whomever needs to make a decision, in case that person
not following along right now.
Cheers,
Derrell
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel