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

Named params exclude . character #259

Closed
ydnar opened this issue Sep 3, 2014 · 7 comments
Closed

Named params exclude . character #259

ydnar opened this issue Sep 3, 2014 · 7 comments

Comments

@ydnar
Copy link
Contributor

ydnar commented Sep 3, 2014

In utils/Path.js:28, the regular expression ([^./?#]+) excludes . (dot) characters from named params. While the rest (/ ? #) seem to make sense to exclude from a / delimited parameterized path, dots can be present in path components. We use dotted params in Domainr, e.g.:

Consider dropping the . constraint? ([^/?#]+) Possible to monkeypatch this?

@ydnar ydnar changed the title Route: named params exclude . character Named params exclude . character Sep 3, 2014
@mjackson
Copy link
Member

mjackson commented Sep 3, 2014

This is by design. :) If you'd like to match the . character, use a *

<!-- Match "godaddy.com" -->
<Route path="*">
<!-- Match "foo.ap/with/foo.app" -->
<Route path="*/with/*">

Keep in mind that when using multiple *, this.props.params.splat will be an array. Otherwise, it will be a string.

Does that work?

@mjackson
Copy link
Member

mjackson commented Sep 3, 2014

@ydnar On second thought, let's just remove the . from that RegExp. It's not terribly useful in URLs.

@mjackson
Copy link
Member

mjackson commented Sep 3, 2014

@ydnar Wanna do a PR ? :D

@ydnar
Copy link
Contributor Author

ydnar commented Sep 3, 2014

Hah! Whiplash. Will send a PR.

@ydnar
Copy link
Contributor Author

ydnar commented Sep 3, 2014

Done.

Randy

On Wed, Sep 3, 2014 at 12:15 PM, Michael Jackson notifications@github.com
wrote:

@ydnar https://github.com/ydnar Wanna do a PR ? :D


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

mjackson added a commit that referenced this issue Sep 3, 2014
[changed] #259 support dots in named params
@mjackson
Copy link
Member

mjackson commented Sep 3, 2014

Boom

@mjackson mjackson closed this as completed Sep 3, 2014
@mjackson
Copy link
Member

mjackson commented Sep 3, 2014

Thanks @ydnar!

@lock lock bot locked as resolved and limited conversation to collaborators Jan 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants