aspnet / BasicMiddleware

[Archived] Basic middleware components for ASP.NET Core. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
169 stars 84 forks source link

ExactMatch should set BackReference #149

Closed BrennanConroy closed 8 years ago

BrennanConroy commented 8 years ago

The back reference will just be the pattern https://github.com/aspnet/BasicMiddleware/blob/dev/src/Microsoft.AspNetCore.Rewrite/Internal/UrlMatches/ExactMatch.cs#L21

muratg commented 8 years ago

We should add a couple test cases for the use cases.

mikaelm12 commented 8 years ago

So the BackReference isn't set here because a string compare is being used here in stead of a regex match. We can either do a regex match here or we have to change the BackReference to be something other than a GroupCollection Thoughts @Tratcher @natemcmaster @BrennanConroy?

BrennanConroy commented 8 years ago

Fix the GroupCollection!

jkotalik commented 8 years ago

Seriously. I couldn't use an dict/list because it would add an extra O(n) operation to transfer it. IMO group collection should have an interface similar to a list, but unfortunately there isn't.

mikaelm12 commented 8 years ago

@muratg The 1.1.0 fix for this is to just do a regex match instead of a string compare and set the back reference with the GroupCollectionfrom the regex match. The 1.2.0 solution for fixing the TrackAllCaptures will need to use it

muratg commented 8 years ago

141 is tracking this work.