I'll write a unit test and then fix it. 

On Jan 23, 2011, at 1:09 PM, Massimo Di Pierro <[email protected]> 
wrote:

> I think we should change it and treat is like a bug.
> 
> On Jan 23, 12:46 pm, Jonathan Lundell <[email protected]> wrote:
>> On Jan 23, 2011, at 8:24 AM, Kenneth Lundström wrote:
>> 
>> 
>> 
>>> Has it allways been like this or?
>> 
>>> http://...../application/controller/function/args1  len(request.args) = 1
>>> http://...../application/controller/function/args1/args2  len(request.args) 
>>> = 2
>> 
>>> but
>>> http://...../application/controller/function/args1/  len(request.args) = 2
>> 
>>> I would have guessed that the last case would have returned length as 1
>> 
>> OK, I looked at the source: split('/') with no strip, so a trailing '/' will 
>> give you an empty string for the last arg. And I think that both the new and 
>> old versions do the same thing.
>> 
>> We could change it, I suppose, but someone might be relying on the current 
>> behavior. Though that would be a little strange, I guess.
>> 
>> It's an accident of the original regex that parses the URL. It appears to be 
>> intended to strip the trailing slash, but the args pattern is greedy and 
>> sucks it in for itself.
>> 
>> Massimo, do you have an opinion? It'd be trivial to strip slashes.

Reply via email to