Closed DamianEdwards closed 6 years ago
@muratg @glennc
Wondering what other missing server variables there are....
I blame documentation even though it is like 90% my fault XD
This patch bug is approved. Please use the normal code review process w/ a PR and make sure the fix is in the correct branch, then close the bug and mark it as done.
@muratg please assign this bug.
Did this get removed? After upgrading our Asp.net core project from 1.1 to 2.0 (using the AspnetCore.All
package) I now get the following error:
System.FormatException: Unrecognized parameter type: 'REQUEST_METHOD', terminated at string index: '15'
at Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.ServerVariables.FindServerVariable(String serverVariable, ParserContext context, UriMatchPart uriMatchPart)
at Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.InputParser.ParseParameter(ParserContext context, IList`1 results, UriMatchPart uriMatchPart)
at Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.InputParser.ParseString(ParserContext context, UriMatchPart uriMatchPart)
at Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.InputParser.ParseInputString(String testString, UriMatchPart uriMatchPart)
at Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.UriMatchCondition..ctor(InputParser inputParser, String input, String pattern, UriMatchPart uriMatchPart, Boolean ignoreCase, Boolean negate)
at Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.UrlRewriteFileParser.ParseCondition(XElement conditionElement, UrlRewriteRuleBuilder builder, PatternSyntax patternSyntax)
at Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.UrlRewriteFileParser.ParseConditions(XElement conditions, UrlRewriteRuleBuilder builder, PatternSyntax patternSyntax)
at Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.UrlRewriteFileParser.ParseRuleAttributes(XElement rule, UrlRewriteRuleBuilder builder)
at Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.UrlRewriteFileParser.ParseRules(XElement rules, IList`1 result, Boolean global)
at Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.UrlRewriteFileParser.Parse(TextReader reader)
at Microsoft.AspNetCore.Rewrite.IISUrlRewriteOptionsExtensions.AddIISUrlRewrite(RewriteOptions options, TextReader reader)
at Microsoft.AspNetCore.Rewrite.IISUrlRewriteOptionsExtensions.AddIISUrlRewrite(RewriteOptions options, IFileProvider fileProvider, String filePath)
......
when calling rewriteOptions.AddIISUrlRewrite(env.ContentRootFileProvider, file);
Our rewrite definition file has <add input="{REQUEST_METHOD}" pattern="GET" ignoreCase="true" />
@KallDrexx seems you are right. It was added to the 1.0/1.1 branch https://github.com/aspnet/BasicMiddleware/commits/release/1.1 but not the 2.0 branch https://github.com/aspnet/BasicMiddleware/commits/release/2.0?after=8fd34cbb2f62cdf43a892289439b4bdf54ff9699+69. Seems to also not be in dev. @mikaelm12 can you forward port this change? cc/ @muratg we probably want to patch this for 2.0.x and add this back into dev as it was patched in the 1.1.x chain.
Agree this should be patched in 2.0.x
Do we want to sneak this into preview1? @DamianEdwards @muratg
If the port is straightforward and can be done simply and safely, then it'd be good to get this in preview1
Can we get bugs logged for EACH applicable milestone, and then close this bug?
Can we get bugs logged for EACH applicable milestone
We don't have a 2.0.7 milestone though yet, right? Because this wouldn't be going into 2.0.6? Should I just go ahead and add the milestone?
Put in 2.0.6 for now.
This is now being tracked in #292 and #293
We should support the
{REQUEST_METHOD}
variable when parsing IIS URL Rewrite files. If there's a code equivalent we should support it there too of course. It represents the current request verb (e.g. 'get', 'head', 'post', etc.).As it stands, the rules in live.asp.net aren't supported.