[cgiapp] CAP Dispatch and encoded backslashes

Ron Savage ron at savage.net.au
Thu Jun 7 01:45:15 EDT 2012


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.

-- 
Ron Savage
http://savage.net.au/
Ph: 0421 920 622


More information about the cgiapp mailing list