Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routes must have leading slash #581

Closed
racke opened this issue May 1, 2014 · 14 comments
Closed

Routes must have leading slash #581

racke opened this issue May 1, 2014 · 14 comments

Comments

@racke
Copy link
Member

racke commented May 1, 2014

Please check whether false routes work in Dancer2. Even if they do, we should port the test to Dancer2.

Reference:

PerlDancer/Dancer#1020

Regards
Racke

@yanick
Copy link
Contributor

yanick commented May 1, 2014

Do'h. Forgot to check if it needed to be forward-ported to Dancer2. Thanks for the ticket, @racke !

@veryrusty
Copy link
Member

Dancer2 requires all routes defined with via a string to begin with /. (Handled within BUILDARGS of Dancer2/Core/Route.pm ). The test routes would become /0, /, and /, which don't have the same logical issue.

The requirement for a leading / could be a bug; or needs including in the D2 migration docs (when written).

@xsawyerx
Copy link
Member

xsawyerx commented May 2, 2014

Can you imagine a situation in which a route wouldn't start with a leading /?

@racke
Copy link
Member Author

racke commented May 2, 2014

On 05/02/2014 09:26 AM, Sawyer X wrote:

Can you imagine a situation in which a route wouldn't start with a leading |/|?

The justification in the Dancer1 patch was to use it with prefix.

At any rate, it doesn't make sense to me to introduce a different behaviour between
Dancer1 and Dancer2.

Regards
Racke

LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team

@xsawyerx
Copy link
Member

xsawyerx commented May 2, 2014

If the behavior in 1 is incorrect, 2 is the place to fix it.

@racke
Copy link
Member Author

racke commented May 2, 2014

On 05/02/2014 09:44 AM, Sawyer X wrote:

If the behavior in 1 is incorrect, 2 is the place to fix it.


Reply to this email directly or view it on GitHub #581 (comment).

Why not fix it in 1 as well?

Regards
Racke

LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team

@xsawyerx
Copy link
Member

xsawyerx commented May 2, 2014

Good question.

@yanick
Copy link
Contributor

yanick commented May 2, 2014

I think I would reformulate

"If the behavior in 1 is incorrect, 2 is the place to fix it."

as

"If the behavior in 1 is incorrect and we only have tuits to fix it in one place, then 2 is the place to fix it."

I understand that we have limited resources and we don't want to go too deep in Dancer1 salvaging. But let's also factor in the effort required, and the added value to the users.

... did I just used "added value" in a sentence? Kill me.

@xsawyerx
Copy link
Member

xsawyerx commented May 2, 2014

I completely agree. I think you're the person in the best position to say "this doesn't add much, and it will take too much work". Trust me that we all trust you if you say that. :)

@racke
Copy link
Member Author

racke commented May 2, 2014

OK, in this case we could add it to #583 and close this issue.

@mickeyn
Copy link
Contributor

mickeyn commented May 28, 2014

We discussed this issue and decided to prevent false routes, so we can be consistent in producing routes using prefixes.
All routes have to start with '/'.

@xsawyerx xsawyerx changed the title False routes Routes must have leading slash May 28, 2014
@xsawyerx
Copy link
Member

@omar-m-othman is claiming this one.

@xsawyerx
Copy link
Member

A leading slash should be checked here.

@xsawyerx
Copy link
Member

A leading slash is actually already checked:

use Dancer2;
get '' => sub {1};

Returns the next error:

regexp must begin with /

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants