96 references to UriMatchPart
Microsoft.AspNetCore.Rewrite (14)
IISUrlRewrite\InputParser.cs (4)
35return ParseInputString(testString, UriMatchPart.Path); 45public Pattern ParseInputString(string testString, UriMatchPart uriMatchPart) 56private Pattern ParseString(ParserContext context, UriMatchPart uriMatchPart) 85private void ParseParameter(ParserContext context, IList<PatternSegment> results, UriMatchPart uriMatchPart)
IISUrlRewrite\ServerVariables.cs (1)
20public static PatternSegment FindServerVariable(string serverVariable, ParserContext context, UriMatchPart uriMatchPart, bool alwaysUseManagedServerVariables)
IISUrlRewrite\UriMatchCondition.cs (2)
13public UriMatchCondition(InputParser inputParser, string input, string pattern, UriMatchPart uriMatchPart, bool ignoreCase, bool negate) 18private static Pattern CreatePattern(InputParser inputParser, string input, UriMatchPart uriMatchPart)
IISUrlRewrite\UrlRewriteRuleBuilder.cs (3)
16public UriMatchPart UriMatchPart => Global ? UriMatchPart.Full : UriMatchPart.Path;
PatternSegments\UrlSegment.cs (4)
11private readonly UriMatchPart _uriMatchPart; 14: this(UriMatchPart.Path) 18public UrlSegment(UriMatchPart uriMatchPart) 25return _uriMatchPart == UriMatchPart.Full ? context.HttpContext.Request.GetEncodedUrl() : (string)context.HttpContext.Request.Path;
Microsoft.AspNetCore.Rewrite.Tests (82)
IISUrlRewrite\FileParserTests.cs (2)
184UriMatchPart uriMatchPart = UriMatchPart.Path,
IISUrlRewrite\InputParserTests.cs (11)
20var result = new InputParser().ParseInputString(testString, UriMatchPart.Path); 32var result = new InputParser().ParseInputString(testString, UriMatchPart.Path); 48var middle = new InputParser().ParseInputString(testString, UriMatchPart.Path); 61var middle = new InputParser().ParseInputString(testString, UriMatchPart.Path); 71var middle = new InputParser().ParseInputString(testString, UriMatchPart.Path); 80var middle = new InputParser().ParseInputString(testString, UriMatchPart.Path); 98var middle = new InputParser().ParseInputString(testString, UriMatchPart.Path); 118Assert.Throws<FormatException>(() => new InputParser().ParseInputString(testString, UriMatchPart.Path)); 124Assert.Throws<FormatException>(() => new InputParser(null, false).ParseInputString("{apiMap:{R:1}}", UriMatchPart.Path)); 134Assert.Throws<FormatException>(() => new InputParser(maps, false).ParseInputString($"{{{undefinedMapName}:{{R:1}}}}", UriMatchPart.Path)); 148var pattern = new InputParser(maps, false).ParseInputString(inputString, UriMatchPart.Path);
IISUrlRewrite\MiddleWareTests.cs (4)
701[InlineData(@"^http://localhost(/.*)", "http://localhost/foo/bar", (int)UriMatchPart.Path)] 702[InlineData(@"^http://localhost(/.*)", "http://www.test.com/foo/bar", (int)UriMatchPart.Full)] 719(UriMatchPart)uriMatchPart, 727inputParser.ParseInputString(@"http://www.test.com{C:1}", (UriMatchPart)uriMatchPart),
IISUrlRewrite\ServerVariableTests.cs (52)
14[InlineData("CONTENT_LENGTH", "10", (int)UriMatchPart.Path)] 15[InlineData("CONTENT_TYPE", "json", (int)UriMatchPart.Path)] 16[InlineData("HTTP_ACCEPT", "accept", (int)UriMatchPart.Path)] 17[InlineData("HTTP_COOKIE", "cookie", (int)UriMatchPart.Path)] 18[InlineData("HTTP_HOST", "example.com", (int)UriMatchPart.Path)] 19[InlineData("HTTP_REFERER", "referer", (int)UriMatchPart.Path)] 20[InlineData("HTTP_USER_AGENT", "useragent", (int)UriMatchPart.Path)] 21[InlineData("HTTP_CONNECTION", "connection", (int)UriMatchPart.Path)] 22[InlineData("HTTP_URL", "/foo", (int)UriMatchPart.Path)] 23[InlineData("HTTP_URL", "http://example.com/foo?bar=1", (int)UriMatchPart.Full)] 24[InlineData("QUERY_STRING", "bar=1", (int)UriMatchPart.Path)] 25[InlineData("REQUEST_FILENAME", "/foo", (int)UriMatchPart.Path)] 26[InlineData("REQUEST_URI", "/foo", (int)UriMatchPart.Path)] 27[InlineData("REQUEST_URI", "http://example.com/foo?bar=1", (int)UriMatchPart.Full)] 28[InlineData("REQUEST_METHOD", "GET", (int)UriMatchPart.Full)] 29[InlineData("SERVER_NAME", "example.com", (int)UriMatchPart.Full)] 34var serverVar = ServerVariables.FindServerVariable(variable, testParserContext, (UriMatchPart)uriMatchPart, true); 41[InlineData("CONTENT_LENGTH", "20", (int)UriMatchPart.Path)] 42[InlineData("CONTENT_TYPE", "text/xml", (int)UriMatchPart.Path)] 43[InlineData("HTTP_ACCEPT", "other-accept", (int)UriMatchPart.Path)] 44[InlineData("HTTP_COOKIE", "other-cookie", (int)UriMatchPart.Path)] 45[InlineData("HTTP_HOST", "otherexample.com", (int)UriMatchPart.Path)] 46[InlineData("HTTP_REFERER", "other-referer", (int)UriMatchPart.Path)] 47[InlineData("HTTP_USER_AGENT", "other-useragent", (int)UriMatchPart.Path)] 48[InlineData("HTTP_CONNECTION", "other-connection", (int)UriMatchPart.Path)] 49[InlineData("HTTP_URL", "http://otherexample.com/other-foo?bar=2", (int)UriMatchPart.Full)] 50[InlineData("HTTP_URL", "http://otherexample.com/other-foo?bar=2", (int)UriMatchPart.Path)] 51[InlineData("QUERY_STRING", "bar=2", (int)UriMatchPart.Path)] 52[InlineData("REQUEST_FILENAME", "/other-foo", (int)UriMatchPart.Path)] 53[InlineData("REQUEST_URI", "/other-foo", (int)UriMatchPart.Path)] 54[InlineData("REQUEST_URI", "/other-foo", (int)UriMatchPart.Full)] 55[InlineData("REQUEST_METHOD", "POST", (int)UriMatchPart.Full)] 56[InlineData("SERVER_NAME", "otherexample.com", (int)UriMatchPart.Full)] 61var serverVar = ServerVariables.FindServerVariable(variable, testParserContext, (UriMatchPart)uriMatchPart, false); 89[InlineData("CONTENT_LENGTH", "10", (int)UriMatchPart.Path)] 90[InlineData("CONTENT_TYPE", "json", (int)UriMatchPart.Path)] 91[InlineData("HTTP_ACCEPT", "accept", (int)UriMatchPart.Path)] 92[InlineData("HTTP_COOKIE", "cookie", (int)UriMatchPart.Path)] 93[InlineData("HTTP_HOST", "example.com", (int)UriMatchPart.Path)] 94[InlineData("HTTP_REFERER", "referer", (int)UriMatchPart.Path)] 95[InlineData("HTTP_USER_AGENT", "useragent", (int)UriMatchPart.Path)] 96[InlineData("HTTP_CONNECTION", "connection", (int)UriMatchPart.Path)] 97[InlineData("HTTP_URL", "/foo", (int)UriMatchPart.Path)] 98[InlineData("HTTP_URL", "http://example.com/foo?bar=1", (int)UriMatchPart.Full)] 99[InlineData("QUERY_STRING", "bar=1", (int)UriMatchPart.Path)] 100[InlineData("REQUEST_FILENAME", "/foo", (int)UriMatchPart.Path)] 101[InlineData("REQUEST_URI", "/foo", (int)UriMatchPart.Path)] 102[InlineData("REQUEST_URI", "http://example.com/foo?bar=1", (int)UriMatchPart.Full)] 103[InlineData("REQUEST_METHOD", "GET", (int)UriMatchPart.Full)] 104[InlineData("SERVER_NAME", "example.com", (int)UriMatchPart.Full)] 109var serverVar = ServerVariables.FindServerVariable(variable, testParserContext, (UriMatchPart)uriMatchPart, true); 177var serverVar = ServerVariables.FindServerVariable("QUERY_STRING", testParserContext, UriMatchPart.Path, true);
PatternSegments\UrlSegmentTests.cs (13)
13[InlineData("http", "localhost", 80, null, (int)UriMatchPart.Path, "")] 14[InlineData("http", "localhost", 80, "", (int)UriMatchPart.Path, "")] 15[InlineData("http", "localhost", 80, "/foo/bar", (int)UriMatchPart.Path, "/foo/bar")] 16[InlineData("http", "localhost", 80, "/foo:bar", (int)UriMatchPart.Path, "/foo:bar")] 17[InlineData("http", "localhost", 80, "/foo bar", (int)UriMatchPart.Path, "/foo%20bar")] 18[InlineData("http", "localhost", 80, null, (int)UriMatchPart.Full, "http://localhost:80/")] 19[InlineData("http", "localhost", 80, "", (int)UriMatchPart.Full, "http://localhost:80/")] 20[InlineData("http", "localhost", 80, "/foo:bar", (int)UriMatchPart.Full, "http://localhost:80/foo:bar")] 21[InlineData("http", "localhost", 80, "/foo bar", (int)UriMatchPart.Full, "http://localhost:80/foo%20bar")] 22[InlineData("http", "localhost", 80, "/foo/bar", (int)UriMatchPart.Full, "http://localhost:80/foo/bar")] 23[InlineData("http", "localhost", 81, "/foo/bar", (int)UriMatchPart.Full, "http://localhost:81/foo/bar")] 24[InlineData("https", "localhost", 443, "/foo/bar", (int)UriMatchPart.Full, "https://localhost:443/foo/bar")] 37var segment = new UrlSegment((UriMatchPart)uriMatchPart);