Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

allow_path_info and single / #8

Open
melo opened this Issue · 5 comments

2 participants

Pedro Melo Jonathan Swartz
Pedro Melo
Collaborator
melo commented

If I have a component in the root of my site named foo with allow_path_info enabled, the following URLs match:

  • /foo: gives me an empty path info;
  • /foo/something: gives me something as path info.

This URL does not match:

  • /foo/

I think it should and path_info should be '/'.

Thoughts?

Jonathan Swartz
Owner
Jonathan Swartz
Owner
Pedro Melo
Collaborator
melo commented

Jonathan, no worries about the delays :)

Although I would personally choose to treat /foo/bar/ the same as /foo/bar, I also admit that it is because I'm biased to think in terms of mapping URLs to filesystems.

They are not the same URL, although years of automatic redirects by Apache and nginx from one to the other have trained us to think of them as the same.

I would keep path_info => '/' because it would allow each developer to decide if they are the same or not. Usually I like opinionated frameworks, but only if they let me choose my wrong way, if I really really need it.

Jonathan Swartz
Owner

Hmmm. I think that ignoring trailing slashes is probably the vast common case, so I don't want to require more work for that case. Maybe it can ignore them by default but provide an option to expose them...

Pedro Melo
Collaborator
melo commented

Sure, that works too

Pedro Melo melo referenced this issue from a commit in melo/perl-mason
Pedro Melo Add two new test cases that should match
One of them, /foo/, fails right now, due to the fix for #8.

Signed-off-by: Pedro Melo <melo@simplicidade.org>
09e9980
Pedro Melo melo referenced this issue from a commit in melo/perl-mason
Pedro Melo Redo fix for #8, respecting the index matches without allow_path_info
Signed-off-by: Pedro Melo <melo@simplicidade.org>
2a58680
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.