Skip to content

Conversation

@chrisinajar
Copy link

Failing test cases for #2617 and optional support for future index value in path-to-regexp from pillarjs/path-to-regexp#51

The issue is that wildcard *'s result in extra capture groups in the regexp, which is expected, however the keys array doesn't account for this at all. The result is that if you have a * wildcard before any :named parameters then their values will be flip-flopped.

At first I tried making path-to-regexp return the wildcard groups in the keys array, however it resulted in deadlocking the testcase without any errors, so I deemed it too API breaking. Instead I added an "index" value to the keys which correlates to the index in the array of matches.

@dougwilson
Copy link
Contributor

Nice :)! Any insight into the one failing test?

@chrisinajar
Copy link
Author

Yup, it wont pass until pillarjs/path-to-regexp#51 is in..... it'll also need to get tagged and put into npm and then we'll need to update the package.json, so it's not exactly the quickest fix.

@dougwilson
Copy link
Contributor

Gothcha, makes sense :) Sounds like a solid plan to me. I'll check out the changes in the meantime :D

@blakeembrey
Copy link
Member

[email protected] has been released with an index property to support Express 4.x.

@dougwilson
Copy link
Contributor

Whoo! I really appreciate your effort :) I really want to get an updated debug module, but idk how long I want to keep waiting, lol

@dougwilson
Copy link
Contributor

Spoke before I checked: debug was published :D

sparkida added a commit to sparkida/express that referenced this pull request May 22, 2015
@dougwilson dougwilson mentioned this pull request May 22, 2015
@dougwilson dougwilson added this to the 4.13 milestone Jun 19, 2015
@dougwilson dougwilson added the bug label Jun 19, 2015
@dougwilson dougwilson mentioned this pull request Jun 19, 2015
6 tasks
@dougwilson
Copy link
Contributor

Thanks for this and getting regexp-to-path updated! The code changed here isn't actually using path-to-regexp's API correctly, but I can get that fixed.

@dougwilson
Copy link
Contributor

Looks like I found a bug pillarjs/path-to-regexp#55 that is blocking the upgrade to 0.1.5. Hopefully it'll get fixed soon :)!

@dougwilson
Copy link
Contributor

Ah, @chrisinajar , I see you actually implemented the feature in path-to-regexp :)! So yea, the issue comes down to that the new index properties are wrong in various ways when you pass in an array to pathToRegexp(), which is a show-stopped for us to actually upgrade and use the new feature here in Express.

I originally had this fix targeted for 4.13, but with this issue and no fix in sight, I'm dropping the 4.13 milestone. I plan to get 4.13 released by Monday 6/22 and if this fix misses that window, it won't have a chance of getting released until 4.14, in 1-2 months.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants