On Jan 27, 2011, at 11:54 AM, DenesL <denes1...@yahoo.ca> wrote:

> Hi Jonathan,
> 
> On Jan 27, 12:04 am, Jonathan Lundell <jlund...@pobox.com> wrote:
>> This applies to both the old and new URL rewrite paths, regardless of 
>> whether there's any rewriting going on.
>> 
>> Previously, a trailing slash after args would cause an extra arg to be added 
>> to the list with a value of '' (empty string). In the old logic, an embedded 
>> empty arg was illegal.
>> 
>> That is:
>> 
>> /a/c/f/arg1
>> 
>> gave args as ['arg1']
>> 
>> /a/c/f/arg1/
>> 
>> gave args as ['arg1', '']
>> 
>> /a/c/f/arg1//arg2
>> 
>> was illegal.
>> 
>> Now, trailing slashes are stripped, so the first two examples about give 
>> ['arg1'], as does /a/c/f/arg1/////
> 
> Maybe that should be parsed as ['arg1', '', '', '', '']

Maybe, but it seems to me that it's confusing unless we also recognize a single 
trailing slash as an empty arg. I don't have a strong opinion.

> 
>> Also, embedded empty args are legal, so the arg2 example above yields ['', 
>> 'arg2']
> 
> Did you mean ['arg1', '', 'arg2'] ?

Right.

> 
> I have not checked, but are those series of slashes legal according to
> an RFC?.

Good question. I'll have a look.

RFC 3986 (generic URI) allows segments to be empty. However, a relative URL of 
the form '//a/b' is supposed to interpret a as the authority (domain). That's 
not an issue for web2py, since we'll always have a function at least before 
args unless someone does a really strange rewrite, in which case they need to 
avoid that pattern.

> 
> Denes.
> 
> 
> On Jan 27, 12:04 am, Jonathan Lundell <jlund...@pobox.com> wrote:
>> This applies to both the old and new URL rewrite paths, regardless of 
>> whether there's any rewriting going on.
>> 
>> Previously, a trailing slash after args would cause an extra arg to be added 
>> to the list with a value of '' (empty string). In the old logic, an embedded 
>> empty arg was illegal.
>> 
>> That is:
>> 
>> /a/c/f/arg1
>> 
>> gave args as ['arg1']
>> 
>> /a/c/f/arg1/
>> 
>> gave args as ['arg1', '']
>> 
>> /a/c/f/arg1//arg2
>> 
>> was illegal.
>> 
>> Now, trailing slashes are stripped, so the first two examples about give 
>> ['arg1'], as does /a/c/f/arg1/////
>> 
>> Also, embedded empty args are legal, so the arg2 example above yields ['', 
>> 'arg2']

Reply via email to