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

Bugfix: handle double trailing slashes in paths #133

Closed
wants to merge 3 commits into from

Conversation

scalvert
Copy link

As found by @stefanpenner, double trailing slashes caused hard errors when recognizing paths.

Changes:

  1. Added failing test
  2. Fixed recognize to handle trimming double trailing slashes

How to test drive this PR:

  1. Checkout this branch
  2. Run npm start
  3. Ensure tests pass

Question: Do we need to collapse ε segments throughout the path?

@krisselden
Copy link
Collaborator

why should this be fixed inside recognize and not before being passed into recognize?

@@ -24,6 +24,14 @@ QUnit.test("A simple route recognizes", (assert: Assert) => {
assert.equal(router.recognize("/foo/baz"), null);
});

QUnit.test("A simple route with double trailing slashes recognizes", (assert: Assert) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If recognize should clean these, why is it only important to clean the trailing double slashes?

@rwjblue
Copy link
Collaborator

rwjblue commented May 11, 2017

Hmm, I thought we already decided this? We landed emberjs/ember.js#14961, do we still need this PR too?

@scalvert scalvert closed this Sep 11, 2017
@scalvert scalvert deleted the fix-double-trailing-slashes branch September 11, 2017 01:37
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

Successfully merging this pull request may close these issues.

3 participants