-
Notifications
You must be signed in to change notification settings - Fork 820
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
Fix r2-4195: Handle double slash in splash pattern #1100
Conversation
This fixes https://github.com/LLK/scratchr2/issues/4195 by updating the regex to catch two slashes. I decided to intentionally not catch more than 2 – it’ll 404 on 3 or more, which seems appropriate.
What do you think about leaving this simple and just removing the endpoint so it 404s instead? |
I personally like the idea of handling just the double slash – it's a mistake that happens, and that other sites handle for you that i've seen. |
If we're going to support it, I think I would rather have
|
I had it as a redirect before, but was trying to keep the rules simplified – I have no strong preference for keeping it as is if you'd rather see it as its own redirect rule. |
In addition to the functional difference, I think I would actually prefer the redirect for simplicity's sake, since then the route pattern is easier to read. |
Same as in the PR details – I kind of felt that anything more than two slashes should 404. |
@@ -7,6 +7,12 @@ | |||
"title": "Imagine, Program, Share" | |||
}, | |||
{ | |||
"name": "splash-redirect", | |||
"pattern": "^//?$", |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Testing on El Capitan, Chrome 54, Safari 10.0.1, Firefox 45.5:
|
Remove `routeAlias` from splash redirect
@mewtaylor has fixed this, I just checked it & discussed it with him, 3 slashes no longer 404s but anything more than 3 will. Chrome 55, Mac OS El Capitan, Staging & IE 11 on Win 7 VM, Staging
|
This fixes https://github.com/LLK/scratchr2/issues/4195 by updating the regex to catch two slashes. I decided to intentionally not catch more than 2 – it’ll 404 on 3 or more, which seems appropriate.
We could also redirect on 2 slashes to the homepage, but this seemed just as well.