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

Add trackAllCaptures for Back References in Url Rewrite #141

Closed BrennanConroy closed 7 years ago

BrennanConroy commented 8 years ago

e.g.

<condtions trackAllCaptures="true">
  <add input="{QUERY_STRING}" pattern="id=(20)" />
  <add input="{HTTP_HOST}" pattern="(.*)" />
</conditions>
<action type="Redirect" url="https://{C:2}" />

@mikaelm12

BrennanConroy commented 8 years ago

~~Remember, trackAllCaptures is part of the back reference feature https://github.com/aspnet/BasicMiddleware/blob/89a6f453ce5eb85a0c41cf3153d8f790a5fa2103/src/Microsoft.AspNetCore.Rewrite/Internal/IISUrlRewrite/UrlRewriteFileParser.cs#L133~~

BrennanConroy commented 8 years ago

The correct name is trackAllCaptures not trackingAllCaptures https://github.com/aspnet/BasicMiddleware/blob/89a6f453ce5eb85a0c41cf3153d8f790a5fa2103/src/Microsoft.AspNetCore.Rewrite/Internal/IISUrlRewrite/RewriteTags.cs#L24

BrennanConroy commented 8 years ago

BackReference uses RegularExpressions.GroupCollection which doesn't have additive operators, so we'll have to change the structure used to contain the back references.

muratg commented 8 years ago

@mikaelm12 Let's fix the enum name in 1.1. And investigate the back referencing issue. If the potential fix for that is not breaking, we can do it in 1.2 instead.

mikaelm12 commented 8 years ago

Okay. I changed the enum in https://github.com/aspnet/BasicMiddleware/pull/166 This bug should be moved to 1.2 though

mikaelm12 commented 7 years ago

Added in https://github.com/aspnet/BasicMiddleware/pull/178