david-prv / QuickyPHP

A php micro-framework
GNU General Public License v3.0
6 stars 1 forks source link

Simple Wildcard does not allow empty path #11

Open david-prv opened 1 year ago

david-prv commented 1 year ago

Describe the bug When using * in the route pattern, Quicky won't allow leaving this position empty

To Reproduce Steps to reproduce the behavior:

  1. Add a route like "/path/*"
  2. Try to open "/path" in browser

Expected behavior The route is not found. Should it?

david-prv commented 2 months ago

PRO: Assuming * means anything can follow, like .* in RegEx, this would mean that /path, /path/subpath and /path/ should be handled the same according to this matching rule (compare: https://regex101.com/r/y8vLPn/1), as the trailing slash is implicitly always given and the url given in step 2) of the reproduction guide should be equivalent to the first one.