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

Allow double-wildcards, partial-wildcards #69

Open
mitchhentges opened this issue Jan 28, 2016 · 1 comment
Open

Allow double-wildcards, partial-wildcards #69

mitchhentges opened this issue Jan 28, 2016 · 1 comment

Comments

@mitchhentges
Copy link
Member

As of the url-wildcard branch, wildcards can fill in between any two /. This behaviour should be extended to allow partial wildcards (http://foo.com/bar*/*.css) and double-wildcards (e.g. http://foo.com/**/*.css)

Specification

  1. When there's a single * between two /, match any content, so long as it's between the same /
  2. When there's a double-wildcard, allow any content and any number of /, so long as the other parts of the url-mapping "mask" are met
  3. If there's * with other characters between two /, then match the characters, with anything being allowed in place of the wildcard(s)

Things to make this feature not overly complex
(>Implying that it's not already too complex, lol sorry)

  1. If there's more than one double-wildcard, the url-mapping mask is invalid. It'd be too much of a slipperly slope to allow that.
  2. Between two /, there can be a maximum of two separate *. This is to stop situations like: http://foo.com/*cats*bagels*spaghetti_lol*

Examples:

-> mask: http://foo.com/*/style.css
http://foo.com/a.css //not mapped
http://foo.com/bar/style.css //is mapped, see #1
http://foo.com/bar/a/style.css //is not mapped, see #1 (The `/a/` component isn't in the mask)

-> mask: http://foo.com/**/style.css
http://foo.com/a.css //not mapped
http://foo.com/bar/style.css //is mapped, see #2 (any content between `http://foo.com/` and `/style.css` is allowed)
http://foo.com/bar/a/style.css //is mapped, see #2

-> mask: http://foo.com/bar*/*.css
http://foo.com/a.css //not mapped
http://foo.com/bar/style.css //is mapped
http://foo.com/bar/neat.css //is mapped
http://foo.com/bars-and-chipz/neat.css //is mapped
http://foo.com/blitz-bars-and-chipz/neat.css //is not mapped
http://foo.com/bar/a/style.css //is not mapped

-> mask: http://foo.com/**/bar/** //error, can't have multiple **
-> mask: http://foo.com/*bar*baz*/style.css //error, can't have over two * per between two /
@mitchhentges mitchhentges changed the title Allow wildcards at end of url to mean "any further content" Allow double-wildcards, partial-wildcards Jan 28, 2016
@mitchhentges
Copy link
Member Author

What if we just used route-pattern?

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

No branches or pull requests

1 participant