Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Easy bug fix for JSONP callback when callback contains "[]" ex.: callback=callbacks[123]
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Totty  
View profile  
 More options Apr 30 2012, 11:06 pm
From: Totty <webdesignpo...@gmail.com>
Date: Mon, 30 Apr 2012 20:06:30 -0700 (PDT)
Local: Mon, Apr 30 2012 11:06 pm
Subject: Easy bug fix for JSONP callback when callback contains "[]" ex.: callback=callbacks[123]
When my callback looks like callbacks[123] it's converted to
callbacks123 and this leads to an error. I cannot change the code for
the client because it uses a framework (qooxdoo) which manages by
itself the jsonp stuff. So this is the problem:

lib/response.js, Line 139: body = callback.replace(/[^\w$.]/g, '') +
'(' + body + ');';

It's removing the  "[" and "]" when it shouldn't remove them..

thanks


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
tjholowaychuk  
View profile  
 More options May 2 2012, 11:40 am
From: tjholowaychuk <tjholoway...@gmail.com>
Date: Wed, 2 May 2012 08:40:27 -0700 (PDT)
Local: Wed, May 2 2012 11:40 am
Subject: Re: Easy bug fix for JSONP callback when callback contains "[]" ex.: callback=callbacks[123]
it's potentially a security issue if we allow arbitrary chars, but I'm
definitely open to refining things, we should definitely make it work
out-of-the-box with frameworks out there

On Apr 30, 8:06 pm, Totty <webdesignpo...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ryan Schmidt  
View profile  
 More options May 2 2012, 3:14 pm
From: Ryan Schmidt <google-2...@ryandesign.com>
Date: Wed, 2 May 2012 14:14:21 -0500
Local: Wed, May 2 2012 3:14 pm
Subject: Re: Easy bug fix for JSONP callback when callback contains "[]" ex.: callback=callbacks[123]
So if this is to be corrected as Totty suggests, and "[" and "]" are to be allowed, then the corrected line would be:

body = callback.replace(/[^\w$.\[\]]/g, '') + '(' + body + ');';

On May 2, 2012, at 10:40, tjholowaychuk wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Totty  
View profile  
 More options May 6 2012, 11:30 am
From: Totty <webdesignpo...@gmail.com>
Date: Sun, 6 May 2012 08:30:44 -0700 (PDT)
Local: Sun, May 6 2012 11:30 am
Subject: Re: Easy bug fix for JSONP callback when callback contains "[]" ex.: callback=callbacks[123]
thanks. I don't know how these bugs are fixed, but I would like to
allow theses changes in my code. Currently I'm changing my code from
the node_modules that my app uses, but it's not a good option.
thanks

On May 2, 8:14 pm, Ryan Schmidt <google-2...@ryandesign.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ryan Schmidt  
View profile  
 More options May 6 2012, 5:43 pm
From: Ryan Schmidt <google-2...@ryandesign.com>
Date: Sun, 6 May 2012 16:43:39 -0500
Local: Sun, May 6 2012 5:43 pm
Subject: Re: Easy bug fix for JSONP callback when callback contains "[]" ex.: callback=callbacks[123]
The first thing you should probably do is file a bug report:

https://github.com/visionmedia/express/issues

If you can submit a patch to fix it (i.e. by creating a gist of the patch, then putting a link to the gist into the ticket), or submit a pull request of the fix, that would be even better.

On May 6, 2012, at 10:30, Totty wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »