[cgiapp] CAP Dispatch and encoded backslashes

B. Estrade estrabd at gmail.com
Thu Jun 7 16:52:07 EDT 2012


This issue may be rendered moot. I have discovered that I am
unitentionally relying on GET-like behavior to pass data during a
PATCH method request.

I suppose this leads me to ask, is the data in a PATCH request
handled the same way it is in a POST?

Thank you,
Brett

On Thu, Jun 07, 2012 at 09:41:30AM -0500, B. Estrade wrote:
> On Thu, Jun 07, 2012 at 03:45:15PM +1000, Ron Savage wrote:
> > Hi Brett
> > 
> > On 07/06/12 13:42, B. Estrade wrote:
> > > On Thu, Jun 07, 2012 at 01:17:12PM +1000, Ron Savage wrote:
> > >> Hi Brett
> > >>
> > >> On 07/06/12 05:37, B. Estrade wrote:
> > >>> I am having an issue with CAP Dispatch that seems to be rearing its
> > >>> ugly head when I send, as part of the route, serialized JSON data.
> > >>> The issue is that I have a value with a backslash in it.
> > >>>
> > >>> I am pretty sure the URL parsing done by Dispatch is splitting on this
> > >>> backslash, but I though that it wouldn't be a problem since it's being
> > >>> sent as an encoded string.
> > >>>
> > >>> When I don't include this one field, it works; when I do, I get a 404
> > >>> thrown by Dispatch.
> > >>
> > >> The documentation says:
> > >> To get the name of the application module the path is split on
> > >> backslahes (C</>).
> > >>
> > >> Clearly (?) it means slash (/), not backslash (\).
> > >
> > > You are right, it's not the backslash, it's the forward slash. I saw
> > > that part in the docs, but I was not sure how to include that in the
> > > serialized string; I assumed if it was uri encoded it'd be fine.
> > 
> > So the next question is: Does the problematic / get converted to %2f? If 
> > so, I'd expect CAD to ignore it. If not, why not?
> > 
> > I'm thinking that if not, you'll have to use JS attached to the submit 
> > button to capture the value and encode it yourself.
> 
> It is encoded, and I am using YUI 3's Y.IO to submit a POST request. 
> 
> The whole, serialized JSON encoded is:
> 
> %7B%22id%22%3A%228734%22%2C%22name%22%3A%22heello%20the%20dog%22%2C%22email%22%3A%22estrabd%40gmail.com%22%2C%22phone%22%3A%22123456%20%22%2C%22phoneext%22%3A%2278%22%2C%22status%22%3A%22inactive%22%2C%22locale%22%3A%22local%22%2C%22isexempt%22%3Anull%2C%22timezone%22%3A%22American%2FChicago%22%2C%22isdevadmin%22%3Anull%2C%22last_modified%22%3A%222012-06-07%2009%3A36%3A05%22%2C%22adminlvl%22%3A%22-1%22%2C%22vendcode%22%3Anull%2C%22username%22%3A%22iamthefrog%40gmail.com%22%2C%22endday%22%3Anull%2C%22administaffid%22%3A%22-1%22%2C%22startday%22%3Anull%7D
> 
> You'll note the offending character at "American%2FChicago".
> 
> Thanks,
> Brett
> 
> > 
> > -- 
> > Ron Savage
> > http://savage.net.au/
> > Ph: 0421 920 622
> > 
> > #####  CGI::Application community mailing list  ################
> > ##                                                            ##
> > ##  To unsubscribe, or change your message delivery options,  ##
> > ##  visit:  http://lists.openlib.org/mailman/listinfo/cgiapp    ##
> > ##                                                            ##
> > ##  Web archive:   http://lists.openlib.org/pipermail/cgiapp/   ##
> > ##  Wiki:          http://cgiapp.erlbaum.net/                 ##
> > ##                                                            ##
> > ################################################################
> > 
> 
> #####  CGI::Application community mailing list  ################
> ##                                                            ##
> ##  To unsubscribe, or change your message delivery options,  ##
> ##  visit:  http://lists.openlib.org/mailman/listinfo/cgiapp    ##
> ##                                                            ##
> ##  Web archive:   http://lists.openlib.org/pipermail/cgiapp/   ##
> ##  Wiki:          http://cgiapp.erlbaum.net/                 ##
> ##                                                            ##
> ################################################################
> 


More information about the cgiapp mailing list