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

Increases timeout on Regex in Rewrite. #280

Closed jkotalik closed 6 years ago

jkotalik commented 6 years ago

For #279 . This will most likely be the PR to patch back to 1.1.x and 2.0.x. For 2.1.x or 3.0.x, we may want to redesign/ do something a bit different.

Note, the regex objects themselves are all private or created in builders themselves, so it is hard/can't be tested without exposing them.

Eilon commented 6 years ago

For 2.1 I think this is fine, unless we also want to make it configurable. But for patches I'd want a quirk switch to revert the behavior.

jkotalik commented 6 years ago

What do you mean by: "But for patches I'd want a quirk switch to revert the behavior."

Eilon commented 6 years ago

If we end up patching this, we would choose one of two options:

  1. Change the default to 1s, with a "mode" to revert back to the original 1ms behavior.
  2. Leave the behavior as is with a default of 1ms, and have a "mode" to enable the new, longer 1s behavior.

"Quirks" modes are ways to "quirk" the behavior to restore some legacy behavior.

Tratcher commented 6 years ago

Let's move this to the 2.0.0 branch so we can see what the real patch would look like. E.g. you wouldn't do these renames in a patch. Also adding the quirks settings.

I expect our 2.1 fix will be substantially different due to adding a new public API.

jkotalik commented 6 years ago

I'm going to merge this for now and then make a PR to the 2.0.x and 1.1.x branches with the quirk mode. We can address the refactor for the 2.1.x branch at a different point.