You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Gonzalo Aune <go...@gmail.com> on 2008/05/22 17:39:32 UTC

Question about core io.js

Hi people,

im testing the contacts gadget in the PHP container, and the resulting JSON
is this:

throw 1; < don't be evil' >{"http:\/\/www.google.com
\/m8\/feeds\/contacts\/default\/base?alt=json":{"oauthState":"Xr3qeLbELjPrg8nXyRiQfAO0YLNoYaWqmAqraIU0oFiEL9FfV8XD5JPq5s5QoyNId+vJrxrQ0HAR6xo5WAOp+5fdkj0=","approvalUrl":"https:\/\/
www.google.com\/accounts\/OAuthAuthorizeToken?oauth_token="}}

but the io.js isnt formatting me right, and throw me this error: (Firebug
console)

text has no properties
parse(undefined)ifr (line 42)
transformResponseData(Object CONTENT_TYPE=JSON AUTHORIZATION=AUTHENTICATED,
Object)ifr (line 81)
processResponse("
http://www.google.com/m8/feeds/contacts/default/base?alt=json", function(),
Object CONTENT_TYPE=JSON AUTHORIZATION=AUTHENTICATED, XMLHttpRequest)ifr
(line 80)
makeClosure()ifr (line 24)
42return{stringify:stringify,parse:function(text){if(/^[\],:{}\s]*$/.test(text.replace(/\\["\\\/b-u]/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){return
eval('('+text+')');}



I was doing some test, and if i add the line if (resp.text) { to the
transformResponseData method (which that line was there in previous versions
before the switch (params.CONTENT_TYPE) { statemente), it works, so i was
wondering where is my error.

Regards.

G.-

Re: Question about core io.js

Posted by Chris Chabot <ch...@xs4all.nl>.
Thanks, nice catch!

Was a left over from the io.js.patch from https://issues.apache.org/jira/browse/SHINDIG-60 
  (which i later heard was also present & updated in a more recent  
patch in that bug), hope we got all the left overs now :)

	-- Chris

On May 22, 2008, at 9:07 PM, Brian Eaton wrote:

> [+chabotc]
>
> You're right, it's a bug.  Chris, this looks like a merge error from
> r654329: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/core.io/io.js?r1=653895&r2=654329&diff_format=h
>
> Can you please fix it?  I'd do it myself, but I don't have commit  
> access.
>
> Cheers,
> Brian
>
> On Thu, May 22, 2008 at 8:39 AM, Gonzalo Aune  
> <go...@gmail.com> wrote:
>> Hi people,
>>
>> im testing the contacts gadget in the PHP container, and the  
>> resulting JSON
>> is this:
>>
>> throw 1; < don't be evil' >{"http:\/\/www.google.com
>> \/m8\/feeds\/contacts\/default\/base?alt=json": 
>> {"oauthState 
>> ":"Xr3qeLbELjPrg8nXyRiQfAO0YLNoYaWqmAqraIU0oFiEL9FfV8XD5JPq5s5QoyNId 
>> +vJrxrQ0HAR6xo5WAOp+5fdkj0=","approvalUrl":"https:\/\/
>> www.google.com\/accounts\/OAuthAuthorizeToken?oauth_token="}}
>>
>> but the io.js isnt formatting me right, and throw me this error:  
>> (Firebug
>> console)
>>
>> text has no properties
>> parse(undefined)ifr (line 42)
>> transformResponseData(Object CONTENT_TYPE=JSON  
>> AUTHORIZATION=AUTHENTICATED,
>> Object)ifr (line 81)
>> processResponse("
>> http://www.google.com/m8/feeds/contacts/default/base?alt=json",  
>> function(),
>> Object CONTENT_TYPE=JSON AUTHORIZATION=AUTHENTICATED,  
>> XMLHttpRequest)ifr
>> (line 80)
>> makeClosure()ifr (line 24)
>> 42return{stringify:stringify,parse:function(text){if(/^[\],:{}\s]* 
>> $/.test(text.replace(/\\["\\\/b-u]/g,'@').replace(/"[^"\\\n\r]*"| 
>> true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/ 
>> (?:^|:|,)(?:\s*\[)+/g,''))){return
>> eval('('+text+')');}
>>
>>
>>
>> I was doing some test, and if i add the line if (resp.text) { to the
>> transformResponseData method (which that line was there in previous  
>> versions
>> before the switch (params.CONTENT_TYPE) { statemente), it works, so  
>> i was
>> wondering where is my error.
>>
>> Regards.
>>
>> G.-
>>


Re: Question about core io.js

Posted by Brian Eaton <be...@google.com>.
[+chabotc]

You're right, it's a bug.  Chris, this looks like a merge error from
r654329: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/core.io/io.js?r1=653895&r2=654329&diff_format=h

Can you please fix it?  I'd do it myself, but I don't have commit access.

Cheers,
Brian

On Thu, May 22, 2008 at 8:39 AM, Gonzalo Aune <go...@gmail.com> wrote:
> Hi people,
>
> im testing the contacts gadget in the PHP container, and the resulting JSON
> is this:
>
> throw 1; < don't be evil' >{"http:\/\/www.google.com
> \/m8\/feeds\/contacts\/default\/base?alt=json":{"oauthState":"Xr3qeLbELjPrg8nXyRiQfAO0YLNoYaWqmAqraIU0oFiEL9FfV8XD5JPq5s5QoyNId+vJrxrQ0HAR6xo5WAOp+5fdkj0=","approvalUrl":"https:\/\/
> www.google.com\/accounts\/OAuthAuthorizeToken?oauth_token="}}
>
> but the io.js isnt formatting me right, and throw me this error: (Firebug
> console)
>
> text has no properties
> parse(undefined)ifr (line 42)
> transformResponseData(Object CONTENT_TYPE=JSON AUTHORIZATION=AUTHENTICATED,
> Object)ifr (line 81)
> processResponse("
> http://www.google.com/m8/feeds/contacts/default/base?alt=json", function(),
> Object CONTENT_TYPE=JSON AUTHORIZATION=AUTHENTICATED, XMLHttpRequest)ifr
> (line 80)
> makeClosure()ifr (line 24)
> 42return{stringify:stringify,parse:function(text){if(/^[\],:{}\s]*$/.test(text.replace(/\\["\\\/b-u]/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){return
> eval('('+text+')');}
>
>
>
> I was doing some test, and if i add the line if (resp.text) { to the
> transformResponseData method (which that line was there in previous versions
> before the switch (params.CONTENT_TYPE) { statemente), it works, so i was
> wondering where is my error.
>
> Regards.
>
> G.-
>