342 instantiations of PathString
Diagnostics.EFCore.FunctionalTests (2)
DatabaseErrorPageMiddlewareTest.cs (1)
345MigrationsEndPointPath = new PathString(migrationsEndpoint)
MigrationsEndPointMiddlewareTest.cs (1)
81var path = useCustomPath ? new PathString("/EndPoints/ApplyMyMigrations") : MigrationsEndPointOptions.DefaultPath;
IIS.Microbenchmarks (1)
PlaintextBenchmark.cs (1)
44private static readonly PathString _path = new PathString("/plaintext");
InMemory.FunctionalTests (1)
RequestTests.cs (1)
267Assert.Equal(new PathString(expectedPath), await pathTcs.Task);
Microsoft.AspNetCore.Authentication.Cookies (3)
CookieAuthenticationDefaults.cs (3)
27public static readonly PathString LoginPath = new PathString("/Account/Login"); 33public static readonly PathString LogoutPath = new PathString("/Account/Logout"); 39public static readonly PathString AccessDeniedPath = new PathString("/Account/AccessDenied");
Microsoft.AspNetCore.Authentication.Facebook (1)
FacebookOptions.cs (1)
20CallbackPath = new PathString("/signin-facebook");
Microsoft.AspNetCore.Authentication.Google (1)
GoogleOptions.cs (1)
20CallbackPath = new PathString("/signin-google");
Microsoft.AspNetCore.Authentication.MicrosoftAccount (1)
MicrosoftAccountOptions.cs (1)
20CallbackPath = new PathString("/signin-microsoft");
Microsoft.AspNetCore.Authentication.OpenIdConnect (7)
OpenIdConnectConfigureOptions.cs (4)
43options.AccessDeniedPath = new PathString(configSection[nameof(options.AccessDeniedPath)] ?? options.AccessDeniedPath.Value); 47options.CallbackPath = new PathString(configSection[nameof(options.CallbackPath)] ?? options.CallbackPath.Value); 68options.RemoteSignOutPath = new PathString(configSection[nameof(options.RemoteSignOutPath)] ?? options.RemoteSignOutPath.Value); 76options.SignedOutCallbackPath = new PathString(configSection[nameof(options.SignedOutCallbackPath)] ?? options.SignedOutCallbackPath.Value);
OpenIdConnectOptions.cs (3)
44CallbackPath = new PathString("/signin-oidc"); 45SignedOutCallbackPath = new PathString("/signout-callback-oidc"); 46RemoteSignOutPath = new PathString("/signout-oidc");
Microsoft.AspNetCore.Authentication.Test (87)
CookieTests.cs (27)
131o.LoginPath = new PathString("/login"); 258o.LoginPath = new PathString("/login"); 301o.LoginPath = new PathString("/login"); 314o.LoginPath = new PathString("/login"); 336o.LoginPath = new PathString("/login"); 1158Assert.Equal(new PathString("/base"), context.Request.PathBase); 1202o.LoginPath = new PathString("/page"); 1218o.LoginPath = new PathString("/page"); 1245.ConfigureServices(s => s.AddAuthentication().AddCookie(o => o.LoginPath = new PathString("/page")))) 1358.ConfigureServices(services => services.AddAuthentication().AddCookie(o => o.LoginPath = new PathString("/login")))) 1380.ConfigureServices(services => services.AddAuthentication().AddCookie(o => o.LoginPath = new PathString("/login")))) 1406.ConfigureServices(services => services.AddAuthentication().AddCookie(o => o.LogoutPath = new PathString("/logout")))) 1428.ConfigureServices(services => services.AddAuthentication().AddCookie(o => o.LogoutPath = new PathString("/logout")))) 1454.ConfigureServices(services => services.AddAuthentication().AddCookie(o => o.AccessDeniedPath = new PathString("/denied")))) 1479.ConfigureServices(services => services.AddAuthentication().AddCookie(o => o.LoginPath = new PathString("/page")))) 1622.ConfigureServices(services => services.AddAuthentication().AddCookie(o => o.AccessDeniedPath = new PathString("/denied")))) 1820if (req.Path == new PathString("/normal")) 1824else if (req.Path == new PathString("/forbid")) // Simulate forbidden 1828else if (req.Path == new PathString("/challenge")) 1832else if (req.Path == new PathString("/signinalice")) 1836else if (req.Path == new PathString("/signout")) 1840else if (req.Path == new PathString("/unauthorized")) 1844else if (req.Path == new PathString("/protected/CustomRedirect")) 1848else if (req.Path == new PathString("/me")) 1852else if (req.Path.StartsWithSegments(new PathString("/me"), out remainder)) 1857else if (req.Path == new PathString("/testpath") && testpath != null) 1861else if (req.Path == new PathString("/checkforerrors"))
DynamicSchemeTests.cs (3)
141if (req.Path.StartsWithSegments(new PathString("/add"), out var remainder)) 148else if (req.Path.StartsWithSegments(new PathString("/auth"), out remainder)) 154else if (req.Path.StartsWithSegments(new PathString("/remove"), out remainder))
GoogleTests.cs (17)
170if (req.Path == new PathString("/challenge2")) 222if (req.Path == new PathString("/challenge2")) 274if (req.Path == new PathString("/challenge2")) 351if (req.Path == new PathString("/auth")) 1156if (req.Path == new PathString("/challenge")) 1160else if (req.Path == new PathString("/challengeFacebook")) 1164else if (req.Path == new PathString("/tokens")) 1170else if (req.Path == new PathString("/me")) 1174else if (req.Path == new PathString("/authenticate")) 1179else if (req.Path == new PathString("/authenticateGoogle")) 1184else if (req.Path == new PathString("/authenticateFacebook")) 1189else if (req.Path == new PathString("/unauthorized")) 1195else if (req.Path == new PathString("/unauthorizedAuto")) 1200else if (req.Path == new PathString("/401")) 1204else if (req.Path == new PathString("/signIn")) 1208else if (req.Path == new PathString("/signOut")) 1212else if (req.Path == new PathString("/forbid"))
JwtBearerTests.cs (8)
1174if (context.Request.Path == new PathString("/checkforerrors")) 1183else if (context.Request.Path == new PathString("/oauth")) 1204else if (context.Request.Path == new PathString("/token")) 1209else if (context.Request.Path == new PathString("/unauthorized")) 1215else if (context.Request.Path == new PathString("/forbidden")) 1220else if (context.Request.Path == new PathString("/signIn")) 1224else if (context.Request.Path == new PathString("/signOut")) 1228else if (context.Request.Path == new PathString("/expiration"))
JwtBearerTests_Handler.cs (8)
1233if (context.Request.Path == new PathString("/checkforerrors")) 1242else if (context.Request.Path == new PathString("/oauth")) 1263else if (context.Request.Path == new PathString("/token")) 1268else if (context.Request.Path == new PathString("/unauthorized")) 1274else if (context.Request.Path == new PathString("/forbidden")) 1279else if (context.Request.Path == new PathString("/signIn")) 1283else if (context.Request.Path == new PathString("/signOut")) 1287else if (context.Request.Path == new PathString("/expiration"))
MicrosoftAccountTests.cs (7)
367if (req.Path == new PathString("/challenge")) 380else if (req.Path == new PathString("/challengeWithOtherScope")) 386else if (req.Path == new PathString("/challengeWithOtherScopeWithBaseAuthenticationProperties")) 392else if (req.Path == new PathString("/me")) 396else if (req.Path == new PathString("/signIn")) 400else if (req.Path == new PathString("/signOut")) 404else if (req.Path == new PathString("/forbid"))
OpenIdConnect\OpenIdConnectAuthenticateTests.cs (2)
22opt.CallbackPath = new PathString("/"); 47opt.CallbackPath = new PathString("/");
OpenIdConnect\OpenIdConnectTests.cs (1)
448Assert.Equal(new PathString("/signin-oidc"), options.CallbackPath); // Assert default callback paths are respected
OpenIdConnect\TestServerBuilder.cs (6)
75if (req.Path == new PathString(Challenge)) 79else if (req.Path == new PathString(ChallengeWithProperties)) 83else if (req.Path == new PathString(ChallengeWithOutContext)) 87else if (req.Path == new PathString(Signin)) 91else if (req.Path == new PathString(Signout)) 95else if (req.Path == new PathString("/signout_with_specific_redirect_uri"))
PolicyTests.cs (1)
474if (req.Path.StartsWithSegments(new PathString("/auth"), out var remainder))
TwitterTests.cs (5)
547if (req.Path == new PathString("/signIn")) 551else if (req.Path == new PathString("/signOut")) 555else if (req.Path == new PathString("/forbid")) 559else if (req.Path == new PathString("/me")) 563else if (req.Path == new PathString("/tokens"))
WsFederation\WsFederationTest.cs (1)
346context.HttpContext.Request.Path = new PathString("/AuthenticationFailed");
WsFederation\WsFederationTest_Handler.cs (1)
342context.HttpContext.Request.Path = new PathString("/AuthenticationFailed");
Microsoft.AspNetCore.Authentication.Twitter (1)
TwitterOptions.cs (1)
24CallbackPath = new PathString("/signin-twitter");
Microsoft.AspNetCore.Diagnostics (4)
ExceptionHandler\ExceptionHandlerExtensions.cs (2)
46ExceptionHandlingPath = new PathString(errorHandlingPath) 64ExceptionHandlingPath = new PathString(errorHandlingPath),
StatusCodePage\StatusCodePagesExtensions.cs (1)
169var newPath = new PathString(
WelcomePage\WelcomePageExtensions.cs (1)
57Path = new PathString(path)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (1)
MigrationsEndPointOptions.cs (1)
18public static PathString DefaultPath = new PathString("/ApplyDatabaseMigrations");
Microsoft.AspNetCore.Hosting.Tests (2)
Internal\HostingRequestStartLogTests.cs (2)
21mockRequest.Setup(request => request.PathBase).Returns(new PathString("/")); 22mockRequest.Setup(request => request.Path).Returns(new PathString("/"));
Microsoft.AspNetCore.Http (2)
Internal\DefaultHttpRequest.cs (2)
69get { return new PathString(HttpRequestFeature.PathBase); } 75get { return new PathString(HttpRequestFeature.Path); }
Microsoft.AspNetCore.Http.Abstractions (11)
Extensions\UsePathBaseExtensions.cs (1)
26pathBase = new PathString(pathBase.Value?.TrimEnd('/'));
PathString.cs (10)
30public static readonly PathString Empty = new(string.Empty); 185return new PathString(uriComponent); 191return new PathString(pathBuffer.ToString()); 207return new PathString(pathBuffer.ToString()); 290remaining = new PathString(value1[value2.Length..]); 340matched = new PathString(value1.Substring(0, value2.Length)); 341remaining = new PathString(value1[value2.Length..]); 363return new PathString(combined); 366return new PathString(Value + other.Value); 509=> string.IsNullOrEmpty(s) ? new PathString(s) : FromUriComponent(s);
Microsoft.AspNetCore.Http.Abstractions.Tests (32)
MapPathMiddlewareTests.cs (3)
58builder.Map(new PathString(matchPath), UseSuccess); 241context.Request.PathBase = new PathString(basePath); 242context.Request.Path = new PathString(requestPath);
PathStringTests.cs (26)
16ExceptionAssert.ThrowsArgument(() => new PathString("hello"), "value", "The path in 'value' must start with '/'."); 35var pathString = new PathString("/hello"); 45var pathString = new PathString("/hello"); 63var appPath = new PathString(appString); 64var concatPath = new PathString(concatString); 83var appPath = new PathString(appString); 84var concatPath = new PathString(concatString); 98var pathBase = new PathString("/base"); 99var path = new PathString("/path"); 121var source = new PathString(sourcePath); 122var test = new PathString(testPath); 137var source = new PathString(sourcePath); 138var test = new PathString(testPath); 153var source = new PathString(sourcePath); 154var test = new PathString(testPath); 169var source = new PathString(sourcePath); 170var test = new PathString(testPath); 190var source = new PathString(sourcePath); 191var test = new PathString(testPath); 211var source = new PathString(sourcePath); 212var test = new PathString(testPath); 232var source = new PathString(sourcePath); 233var test = new PathString(testPath); 253var source = new PathString(sourcePath); 254var test = new PathString(testPath); 284var path = new PathString(input);
UsePathBaseExtensionsTests.cs (3)
212.UsePathBase(new PathString(registeredPathBase)); 233context.Request.PathBase = new PathString(pathBase); 234context.Request.Path = new PathString(requestPath);
Microsoft.AspNetCore.Http.Extensions (5)
UriHelper.cs (5)
31PathString pathBase = new PathString(), 32PathString path = new PathString(), 54PathString pathBase = new PathString(), 55PathString path = new PathString(), 115path = new PathString();
Microsoft.AspNetCore.Http.Extensions.Tests (16)
UriHelperTests.cs (16)
19var result = UriHelper.BuildRelative(new PathString("/un?escaped/base"), new PathString("/un?escaped"), 36var result = UriHelper.BuildAbsolute("http", new HostString("my.HoΨst:80"), new PathString("/un?escaped/base"), new PathString("/un?escaped"), 75new PathString(pathBase), 76new PathString(path), 89request.PathBase = new PathString("/un?escaped/base"); 90request.Path = new PathString("/un?escaped"); 104request.PathBase = new PathString(pathBase); 105request.Path = new PathString("/un?escaped"); 137var path = new PathString(); 144Assert.Equal(path, new PathString(expectedPath)); 154var path = new PathString("/index.html"); 161var resPath = new PathString(); 177var resPath = new PathString(); 189var resPath = new PathString();
Microsoft.AspNetCore.Http.Results (1)
src\Shared\ResultsHelpers\SharedUrlHelper.cs (1)
22var segment = new PathString(contentPath.Substring(1));
Microsoft.AspNetCore.Http.Results.Tests (9)
CreatedAtRouteOfTResultTests.cs (1)
182httpContext.Request.PathBase = new PathString("");
CreatedAtRouteResultTests.cs (1)
128httpContext.Request.PathBase = new PathString("");
CreatedOfTResultTests.cs (1)
179httpContext.Request.PathBase = new PathString("");
CreatedResultTests.cs (1)
116httpContext.Request.PathBase = new PathString("");
EmptyResultTests.cs (1)
40httpContext.Request.PathBase = new PathString("");
LocalRedirectResultTests.cs (1)
132httpContext.Request.PathBase = new PathString(appRoot);
NotFoundOfTResultTests.cs (1)
142httpContext.Request.PathBase = new PathString("");
NotFoundResultTests.cs (1)
91httpContext.Request.PathBase = new PathString("");
src\Shared\ResultsTests\RedirectResultTestBase.cs (1)
74httpContext.Request.PathBase = new PathString(appRoot);
Microsoft.AspNetCore.HttpLogging.Tests (3)
HttpLoggingMiddlewareTests.cs (2)
1959httpContext.Request.Path = new PathString("/foo"); 1960httpContext.Request.PathBase = new PathString("/foo");
W3CLoggingMiddlewareTests.cs (1)
57httpContext.Request.Path = new PathString("/foo");
Microsoft.AspNetCore.HttpOverrides.Tests (1)
ForwardedHeadersMiddlewareTest.cs (1)
1199c.Request.PathBase = new PathString(pathBase);
Microsoft.AspNetCore.Identity (2)
IdentityCookiesBuilderExtensions.cs (1)
51o.LoginPath = new PathString("/Account/Login");
IdentityServiceCollectionExtensions.cs (1)
61o.LoginPath = new PathString("/Account/Login");
Microsoft.AspNetCore.Identity.InMemory.Test (11)
FunctionalTest.cs (11)
306if (req.Path == new PathString("/normal")) 310else if (req.Path == new PathString("/createMe")) 324else if (req.Path == new PathString("/createSimple")) 329else if (req.Path == new PathString("/signoutEverywhere")) 335else if (req.Path.StartsWithSegments(new PathString("/pwdLogin"), out remainder)) 341else if (req.Path == new PathString("/twofactorRememeber")) 347else if (req.Path == new PathString("/isTwoFactorRememebered")) 353else if (req.Path == new PathString("/hasTwoFactorUserId")) 358else if (req.Path == new PathString("/me")) 362else if (req.Path.StartsWithSegments(new PathString("/me"), out remainder)) 367else if (req.Path == new PathString("/testpath") && testpath != null)
Microsoft.AspNetCore.Mvc.Core (2)
Routing\UrlHelperBase.cs (1)
304var segment = new PathString(contentPath.Substring(1));
src\Shared\ResultsHelpers\SharedUrlHelper.cs (1)
22var segment = new PathString(contentPath.Substring(1));
Microsoft.AspNetCore.Mvc.Core.Test (22)
CreatedAtActionResultTests.cs (1)
78httpContext.Request.PathBase = new PathString("");
CreatedAtRouteResultTests.cs (1)
92httpContext.Request.PathBase = new PathString("");
CreatedResultTests.cs (1)
125httpContext.Request.PathBase = new PathString("");
HttpNotFoundObjectResultTest.cs (1)
58httpContext.Request.PathBase = new PathString("");
Infrastructure\ActionSelectorTest.cs (1)
1108request.SetupGet(r => r.Path).Returns(new PathString());
LocalRedirectResultTest.cs (1)
150httpContext.Request.PathBase = new PathString(appRoot);
RequireHttpsAttributeTests.cs (2)
77requestContext.Request.PathBase = new PathString(pathBase); 82requestContext.Request.Path = new PathString(path);
Routing\AttributeRouteTest.cs (1)
81httpContext.Request.Path = new PathString("/api/Store/Buy/5");
Routing\ControllerLinkGeneratorExtensionsTest.cs (5)
58httpContext.Request.PathBase = new PathString("/Foo/Bar?encodeme?"); 92new PathString("/Foo/Bar?encodeme?"), 116httpContext.Request.PathBase = new PathString("/Foo/Bar?encodeme?"); 153new PathString("/Foo/Bar?encodeme?"), 179httpContext.Request.PathBase = new PathString("/Foo/Bar?encodeme?");
Routing\PageLinkGeneratorExtensionsTest.cs (5)
30httpContext.Request.PathBase = new PathString("/Foo/Bar?encodeme?"); 63new PathString("/Foo/Bar?encodeme?"), 87httpContext.Request.PathBase = new PathString("/Foo/Bar?encodeme?"); 123new PathString("/Foo/Bar?encodeme?"), 149httpContext.Request.PathBase = new PathString("/Foo/Bar?encodeme?");
Routing\UrlHelperBaseTest.cs (1)
125context.Request.PathBase = new PathString(appRoot);
Routing\UrlHelperTestBase.cs (1)
1152context.Request.PathBase = new PathString(appRoot);
src\Shared\ResultsTests\RedirectResultTestBase.cs (1)
74httpContext.Request.PathBase = new PathString(appRoot);
Microsoft.AspNetCore.Mvc.TagHelpers (1)
GlobbingUrlBuilder.cs (1)
159var relativePath = new PathString("/" + matchedPath.Path);
Microsoft.AspNetCore.Mvc.TagHelpers.Test (6)
DefaultFileVersionProviderTest.cs (1)
335return new PathString(requestPathBase);
GlobbingUrlBuilderTest.cs (1)
230var requestPathBase = new PathString(pathBase);
ImageTagHelperTest.cs (2)
200helper.ViewContext.HttpContext.Request.PathBase = new PathString(pathBase); 296actionContext.HttpContext.Request.PathBase = new Http.PathString(requestPathBase);
LinkTagHelperTest.cs (1)
1127actionContext.HttpContext.Request.PathBase = new PathString(requestPathBase);
ScriptTagHelperTest.cs (1)
1108actionContext.HttpContext.Request.PathBase = new PathString(requestPathBase);
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (4)
Rendering\HtmlHelperFormTest.cs (4)
139request.PathBase = new PathString(pathBase); 140request.Path = new PathString(path); 189request.PathBase = new PathString(pathBase); 190request.Path = new PathString(path);
Microsoft.AspNetCore.Owin.Tests (2)
OwinEnvironmentTests.cs (2)
26context.Request.Path = new PathString("/path"); 27context.Request.PathBase = new PathString("/pathBase");
Microsoft.AspNetCore.Rewrite.Tests (3)
PatternSegments\RequestFilenameSegmentTests.cs (1)
17context.HttpContext.Request.Path = new PathString("/foo/bar");
PatternSegments\ServerNameSegmentTests.cs (1)
22httpContext.Request.Path = new PathString("/foo/bar");
PatternSegments\UrlSegmentTests.cs (1)
31httpContext.Request.Path = new PathString(path);
Microsoft.AspNetCore.Routing (1)
UriBuildingContext.cs (1)
258pathString = new PathString(_path.ToString());
Microsoft.AspNetCore.Routing.Tests (23)
DefaultLinkGeneratorTest.cs (4)
300new PathString("/Foo/Bar?encodeme?"), 367httpContext.Request.PathBase = new PathString("/Foo/Bar?encodeme?"); 396new PathString("/Foo/Bar?encodeme?"), 416httpContext.Request.PathBase = new PathString("/Foo/Bar?encodeme?");
LinkGeneratorEndpointNameExtensionsTest.cs (5)
28httpContext.Request.PathBase = new PathString("/Foo/Bar?encodeme?"); 59new PathString("/Foo/Bar?encodeme?"), 77httpContext.Request.PathBase = new PathString("/Foo/Bar?encodeme?"); 110new PathString("/Foo/Bar?encodeme?"), 130httpContext.Request.PathBase = new PathString("/Foo/Bar?encodeme?");
LinkGeneratorRouteValuesAddressExtensionsTest.cs (6)
34httpContext.Request.PathBase = new PathString("/Foo/Bar?encodeme?"); 67new PathString("/Foo/Bar?encodeme?"), 91httpContext.Request.PathBase = new PathString("/Foo/Bar?encodeme?"); 126new PathString("/Foo/Bar?encodeme?"), 152httpContext.Request.PathBase = new PathString("/Foo/Bar?encodeme?"); 184httpContext.Request.PathBase = new PathString("/Foo/Bar?encodeme?");
PathTokenizerTest.cs (3)
82var tokenizer = new PathTokenizer(new PathString(path)); 96var tokenizer = new PathTokenizer(new PathString(path)); 110var tokenizer = new PathTokenizer(new PathString(path));
Patterns\RoutePatternMatcherTest.cs (1)
1111var match = matcher.TryMatch(new PathString(path), values);
RequestDelegateRouteBuilderExtensionsTest.cs (2)
51context.HttpContext.Request.Path = new PathString("/api/5"); 109context.HttpContext.Request.Path = new PathString("/api/5");
Template\TemplateMatcherTests.cs (1)
1110var match = matcher.TryMatch(new PathString(path), values);
Tree\TreeRouterTest.cs (1)
1987request.SetupGet(r => r.Path).Returns(new PathString(requestPath));
Microsoft.AspNetCore.Server.HttpSys (2)
UrlPrefixCollection.cs (2)
84var originalPathString = new PathString(originalPath); 96&& originalPathString.StartsWithSegments(new PathString(prefix.PathWithoutTrailingSlash), StringComparison.OrdinalIgnoreCase, out var remainder)
Microsoft.AspNetCore.Server.IISIntegration (2)
IISMiddleware.cs (1)
28private static readonly PathString ANCMRequestPath = new PathString("/iisintegration");
WebHostBuilderIISExtensions.cs (1)
91services.AddSingleton<IStartupFilter>(new IISSetupFilter(pairingToken, new PathString(path), isWebSocketsSupported));
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
InMemoryTransportBenchmark.cs (1)
239private static readonly PathString _path = new PathString("/plaintext");
NamedPipesTransportBenchmark.cs (1)
137private static readonly PathString _path = new PathString("/plaintext");
Microsoft.AspNetCore.Session.Tests (12)
SessionTests.cs (12)
176if (context.Request.Path == new PathString("/first")) 225if (context.Request.Path == new PathString("/first")) 231else if (context.Request.Path == new PathString("/second")) 237else if (context.Request.Path == new PathString("/third")) 284if (context.Request.Path == new PathString("/first")) 290else if (context.Request.Path == new PathString("/second")) 296else if (context.Request.Path == new PathString("/third")) 393if (context.Request.Path == new PathString("/first")) 399else if (context.Request.Path == new PathString("/second")) 458if (context.Request.Path == new PathString("/AddDataToSession")) 463else if (context.Request.Path == new PathString("/AccessSessionData")) 468else if (context.Request.Path == new PathString("/DoNotAccessSessionData"))
Microsoft.AspNetCore.StaticFiles (6)
DefaultFilesExtensions.cs (1)
48RequestPath = new PathString(requestPath)
DefaultFilesMiddleware.cs (1)
75context.Request.Path = new PathString(Helpers.GetPathValueWithSlash(context.Request.Path) + defaultFile);
DirectoryBrowserExtensions.cs (1)
48RequestPath = new PathString(requestPath)
FileServerExtensions.cs (1)
68RequestPath = new PathString(requestPath)
Helpers.cs (1)
55path += new PathString("/");
StaticFileExtensions.cs (1)
48RequestPath = new PathString(requestPath)
Microsoft.AspNetCore.StaticFiles.FunctionalTests (2)
StaticFileMiddlewareTests.cs (2)
148RequestPath = new PathString(baseUrl), 190RequestPath = new PathString(baseUrl),
Microsoft.AspNetCore.StaticFiles.Tests (31)
DefaultFilesMiddlewareTests.cs (7)
66RequestPath = new PathString(baseUrl), 105RequestPath = new PathString(""), 145RequestPath = new PathString(""), 214RequestPath = new PathString(baseUrl), 259RequestPath = new PathString(baseUrl), 268Assert.Equal("http://localhost" + baseUrl + new PathString(requestUrl + "/") + queryString, actualURL); 314RequestPath = new PathString(baseUrl),
DirectoryBrowserMiddlewareTests.cs (7)
86RequestPath = new PathString(baseUrl), 123RequestPath = new PathString(""), 160RequestPath = new PathString(""), 219RequestPath = new PathString(baseUrl), 263RequestPath = new PathString(baseUrl), 313RequestPath = new PathString(baseUrl), 361RequestPath = new PathString(baseUrl),
StaticFileContextTest.cs (8)
45var pathString = new PathString("/test"); 47httpContext.Request.Path = new PathString("/test/foo.txt"); 71var pathString = new PathString("/test"); 75httpContext.Request.Path = new PathString("/test/foo.txt"); 100var pathString = new PathString("/test"); 104httpContext.Request.Path = new PathString("/test/bar.txt"); 127var pathString = new PathString("/test"); 129httpContext.Request.Path = new PathString("/test/foo.txt");
StaticFileMiddlewareTests.cs (9)
181RequestPath = new PathString(baseUrl), 216RequestPath = new PathString(baseUrl), 256RequestPath = new PathString(baseUrl), 299RequestPath = new PathString(baseUrl), 352RequestPath = new PathString(), 400RequestPath = new PathString(), 456RequestPath = new PathString(), 474RequestPath = new PathString(baseUrl), 534RequestPath = new PathString(baseUrl),
Microsoft.AspNetCore.TestHost (3)
ClientHandler.cs (1)
40pathBase = new PathString(pathBase.Value[..^1]); // All but the last character
TestServer.cs (1)
224pathBase = new PathString(pathBase.Value[..^1]); // All but the last character.
WebSocketClient.cs (1)
29pathBase = new PathString(pathBase.Value[..^1]); // All but the last character.
Microsoft.AspNetCore.TestHost.Tests (9)
ClientHandlerTests.cs (9)
24var handler = new ClientHandler(new PathString(), new InspectingApplication(features => 47var handler = new ClientHandler(new PathString("/A/Path/"), new DummyApplication(context => 73var handler = new ClientHandler(new PathString("/A/Path/"), new InspectingApplication(features => 98var handler = new ClientHandler(new PathString(""), new DummyApplication(context => 113var handler = new ClientHandler(new PathString(""), new DummyApplication(context => 130var handler = new ClientHandler(new PathString(""), new DummyApplication(context => 147var handler = new ClientHandler(new PathString(""), new DummyApplication(context => 163var handler = new ClientHandler(new PathString(""), new DummyApplication(context => 180var handler = new ClientHandler(new PathString(""), new DummyApplication(context =>
SocialSample (4)
Startup.cs (4)
42.AddCookie(o => o.LoginPath = new PathString("/login")) 119o.CallbackPath = new PathString("/signin-github"); 158o.CallbackPath = new PathString("/signin-github-token"); 173o.CallbackPath = new PathString("/signin-identityserver");
473 references to PathString
BasicWebSite (1)
Controllers\RazorComponentsController.cs (1)
56PathString.FromUriComponent("/components/routable") : Request.Path;
CookiePolicySample (1)
Startup.cs (1)
39var path = context.Request.Path;
Diagnostics.EFCore.FunctionalTests (1)
MigrationsEndPointMiddlewareTest.cs (1)
81var path = useCustomPath ? new PathString("/EndPoints/ApplyMyMigrations") : MigrationsEndPointOptions.DefaultPath;
Identity.DefaultUI.WebSite (1)
FileVersionProvider.cs (1)
13public string AddFileVersionToPath(PathString requestPathBase, string path) => path;
IIS.Microbenchmarks (1)
PlaintextBenchmark.cs (1)
44private static readonly PathString _path = new PathString("/plaintext");
InMemory.FunctionalTests (1)
RequestTests.cs (1)
231var pathTcs = new TaskCompletionSource<PathString>(TaskCreationOptions.RunContinuationsAsynchronously);
InProcessWebSite (3)
src\Servers\IIS\IIS\test\testassets\shared\WebSockets\TestStartup.cs (3)
52if (context.Request.Path.StartsWithSegments(requestDelegate.Key, out var matchedPath, out var remainingPath)) 54var pathBase = context.Request.PathBase;
LargeResponseApp (1)
Startup.cs (1)
25var path = context.Request.Path;
Microsoft.AspNetCore.Authentication (6)
AuthenticationHandler.cs (2)
54protected PathString OriginalPath => Context.Features.Get<IAuthenticationFeature>()?.OriginalPath ?? Request.Path; 59protected PathString OriginalPathBase => Context.Features.Get<IAuthenticationFeature>()?.OriginalPathBase ?? Request.PathBase;
Events\AccessDeniedContext.cs (1)
31public PathString AccessDeniedPath { get; set; }
RemoteAuthenticationOptions.cs (2)
88public PathString CallbackPath { get; set; } 96public PathString AccessDeniedPath { get; set; }
RequestPathBaseCookieBuilder.cs (1)
28var originalPathBase = context.Features.Get<IAuthenticationFeature>()?.OriginalPathBase ?? context.Request.PathBase;
Microsoft.AspNetCore.Authentication.Abstractions (2)
IAuthenticationFeature.cs (2)
16PathString OriginalPathBase { get; set; } 21PathString OriginalPath { get; set; }
Microsoft.AspNetCore.Authentication.Cookies (6)
CookieAuthenticationDefaults.cs (3)
27public static readonly PathString LoginPath = new PathString("/Account/Login"); 33public static readonly PathString LogoutPath = new PathString("/Account/Logout"); 39public static readonly PathString AccessDeniedPath = new PathString("/Account/AccessDenied");
CookieAuthenticationOptions.cs (3)
75public PathString LoginPath { get; set; } 80public PathString LogoutPath { get; set; } 85public PathString AccessDeniedPath { get; set; }
Microsoft.AspNetCore.Authentication.Core (2)
AuthenticationFeature.cs (2)
16public PathString OriginalPathBase { get; set; } 21public PathString OriginalPath { get; set; }
Microsoft.AspNetCore.Authentication.OpenIdConnect (2)
OpenIdConnectOptions.cs (2)
194public PathString SignedOutCallbackPath { get; set; } 252public PathString RemoteSignOutPath { get; set; }
Microsoft.AspNetCore.Authentication.Test (3)
CookieTests.cs (1)
1819PathString remainder;
DynamicSchemeTests.cs (1)
141if (req.Path.StartsWithSegments(new PathString("/add"), out var remainder))
PolicyTests.cs (1)
474if (req.Path.StartsWithSegments(new PathString("/auth"), out var remainder))
Microsoft.AspNetCore.Authentication.WsFederation (2)
WsFederationOptions.cs (1)
189public PathString RemoteSignOutPath { get; set; }
WsFederationPostConfigureOptions.cs (1)
55options.CallbackPath = PathString.FromUriComponent(wreply);
Microsoft.AspNetCore.Components.Server (1)
ComponentHub.cs (1)
68public static PathString DefaultPath { get; } = "/_blazor";
Microsoft.AspNetCore.Components.WebAssembly.Server (6)
Builder\WebAssemblyComponentsEndpointOptions.cs (2)
14/// Gets or sets the <see cref="PathString"/> that indicates the prefix for Blazor WebAssembly assets. 17public PathString PathPrefix { get; set; }
ComponentsWebAssemblyApplicationBuilderExtensions.cs (4)
32/// <param name="pathPrefix">The <see cref="Microsoft.AspNetCore.Http.PathString"/> that indicates the prefix for the Blazor WebAssembly application.</param> 34public static IApplicationBuilder UseBlazorFrameworkFiles(this IApplicationBuilder builder, PathString pathPrefix) 42builder.MapWhen(ctx => ctx.Request.Path.StartsWithSegments(pathPrefix, out var rest) && rest.StartsWithSegments("/_framework") && 109var requestPath = fileContext.Context.Request.Path;
Microsoft.AspNetCore.Diagnostics (6)
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (1)
141var originalPath = context.Request.Path;
ExceptionHandler\ExceptionHandlerOptions.cs (1)
18public PathString ExceptionHandlingPath { get; set; }
StatusCodePage\StatusCodePagesExtensions.cs (2)
169var newPath = new PathString( 175var originalPath = context.HttpContext.Request.Path;
WelcomePage\WelcomePageExtensions.cs (1)
35public static IApplicationBuilder UseWelcomePage(this IApplicationBuilder app, PathString path)
WelcomePage\WelcomePageOptions.cs (1)
16public PathString Path { get; set; }
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (5)
DatabaseErrorPageOptions.cs (1)
19public virtual PathString MigrationsEndPointPath { get; set; } = MigrationsEndPointOptions.DefaultPath;
MigrationsEndPointOptions.cs (2)
18public static PathString DefaultPath = new PathString("/ApplyDatabaseMigrations"); 24public virtual PathString Path { get; set; } = DefaultPath;
Views\DatabaseErrorPageModel.cs (2)
15PathString pathBase) 26public PathString PathBase { get; }
Microsoft.AspNetCore.Diagnostics.HealthChecks (8)
Builder\HealthCheckApplicationBuilderExtensions.cs (8)
34public static IApplicationBuilder UseHealthChecks(this IApplicationBuilder app, PathString path) 57public static IApplicationBuilder UseHealthChecks(this IApplicationBuilder app, PathString path, HealthCheckOptions options) 85public static IApplicationBuilder UseHealthChecks(this IApplicationBuilder app, PathString path, int port) 112public static IApplicationBuilder UseHealthChecks(this IApplicationBuilder app, PathString path, string port) 143public static IApplicationBuilder UseHealthChecks(this IApplicationBuilder app, PathString path, int port, HealthCheckOptions options) 169public static IApplicationBuilder UseHealthChecks(this IApplicationBuilder app, PathString path, string port, HealthCheckOptions options) 191private static void UseHealthChecksCore(IApplicationBuilder app, PathString path, int? port, object[] args) 225(c.Request.Path.StartsWithSegments(path, out var remaining) &&
Microsoft.AspNetCore.Hosting (1)
Internal\HostingApplicationDiagnostics.cs (1)
454[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(PathString))]
Microsoft.AspNetCore.Http (2)
Internal\DefaultHttpRequest.cs (2)
67public override PathString PathBase 73public override PathString Path
Microsoft.AspNetCore.Http.Abstractions (89)
Extensions\MapExtensions.cs (2)
35public static IApplicationBuilder Map(this IApplicationBuilder app, PathString pathMatch, Action<IApplicationBuilder> configuration) 49public static IApplicationBuilder Map(this IApplicationBuilder app, PathString pathMatch, bool preserveMatchedPathSegment, Action<IApplicationBuilder> configuration)
Extensions\MapMiddleware.cs (2)
55private async Task InvokeCore(HttpContext context, PathString matchedPath, PathString remainingPath)
Extensions\MapOptions.cs (1)
16public PathString PathMatch { get; set; }
Extensions\UsePathBaseExtensions.cs (1)
21public static IApplicationBuilder UsePathBase(this IApplicationBuilder app, PathString pathBase)
Extensions\UsePathBaseMiddleware.cs (4)
14private readonly PathString _pathBase; 21public UsePathBaseMiddleware(RequestDelegate next, PathString pathBase) 50private async Task InvokeCore(HttpContext context, PathString matchedPath, PathString remainingPath)
HttpRequest.cs (5)
52public abstract PathString PathBase { get; set; } 57/// The value may be <see cref="PathString.Empty"/> if <see cref="PathBase"/> contains the full path, 63public abstract PathString Path { get; set; } 168public PathString PathBase => _request.PathBase; 169public PathString Path => _request.Path;
PathString.cs (74)
20public readonly struct PathString : IEquatable<PathString> 30public static readonly PathString Empty = new(string.Empty); 180public static PathString FromUriComponent(string uriComponent) 199public static PathString FromUriComponent(Uri uri) 211/// Determines whether the beginning of this <see cref="PathString"/> instance matches the specified <see cref="PathString"/>. 213/// <param name="other">The <see cref="PathString"/> to compare.</param> 216/// When the <paramref name="other"/> parameter contains a trailing slash, the <see cref="PathString"/> being checked 217/// must either exactly match or include a trailing slash. For instance, for a <see cref="PathString"/> of "/a/b", 219/// Whereas, a <see cref="PathString"/> of "/a//b/" will return <c>true</c> when compared with "/a/". 221public bool StartsWithSegments(PathString other) 227/// Determines whether the beginning of this <see cref="PathString"/> instance matches the specified <see cref="PathString"/> when compared 230/// <param name="other">The <see cref="PathString"/> to compare.</param> 231/// <param name="comparisonType">One of the enumeration values that determines how this <see cref="PathString"/> and value are compared.</param> 234/// When the <paramref name="other"/> parameter contains a trailing slash, the <see cref="PathString"/> being checked 235/// must either exactly match or include a trailing slash. For instance, for a <see cref="PathString"/> of "/a/b", 237/// Whereas, a <see cref="PathString"/> of "/a//b/" will return <c>true</c> when compared with "/a/". 239public bool StartsWithSegments(PathString other, StringComparison comparisonType) 251/// Determines whether the beginning of this <see cref="PathString"/> instance matches the specified <see cref="PathString"/> and returns 254/// <param name="other">The <see cref="PathString"/> to compare.</param> 258/// When the <paramref name="other"/> parameter contains a trailing slash, the <see cref="PathString"/> being checked 259/// must either exactly match or include a trailing slash. For instance, for a <see cref="PathString"/> of "/a/b", 261/// Whereas, a <see cref="PathString"/> of "/a//b/" will return <c>true</c> when compared with "/a/". 263public bool StartsWithSegments(PathString other, out PathString remaining) 269/// Determines whether the beginning of this <see cref="PathString"/> instance matches the specified <see cref="PathString"/> when compared 272/// <param name="other">The <see cref="PathString"/> to compare.</param> 273/// <param name="comparisonType">One of the enumeration values that determines how this <see cref="PathString"/> and value are compared.</param> 277/// When the <paramref name="other"/> parameter contains a trailing slash, the <see cref="PathString"/> being checked 278/// must either exactly match or include a trailing slash. For instance, for a <see cref="PathString"/> of "/a/b", 280/// Whereas, a <see cref="PathString"/> of "/a//b/" will return <c>true</c> when compared with "/a/". 282public bool StartsWithSegments(PathString other, StringComparison comparisonType, out PathString remaining) 299/// Determines whether the beginning of this <see cref="PathString"/> instance matches the specified <see cref="PathString"/> and returns 302/// <param name="other">The <see cref="PathString"/> to compare.</param> 307/// When the <paramref name="other"/> parameter contains a trailing slash, the <see cref="PathString"/> being checked 308/// must either exactly match or include a trailing slash. For instance, for a <see cref="PathString"/> of "/a/b", 310/// Whereas, a <see cref="PathString"/> of "/a//b/" will return <c>true</c> when compared with "/a/". 312public bool StartsWithSegments(PathString other, out PathString matched, out PathString remaining) 318/// Determines whether the beginning of this <see cref="PathString"/> instance matches the specified <see cref="PathString"/> when compared 321/// <param name="other">The <see cref="PathString"/> to compare.</param> 322/// <param name="comparisonType">One of the enumeration values that determines how this <see cref="PathString"/> and value are compared.</param> 327/// When the <paramref name="other"/> parameter contains a trailing slash, the <see cref="PathString"/> being checked 328/// must either exactly match or include a trailing slash. For instance, for a <see cref="PathString"/> of "/a/b", 330/// Whereas, a <see cref="PathString"/> of "/a//b/" will return <c>true</c> when compared with "/a/". 332public bool StartsWithSegments(PathString other, StringComparison comparisonType, out PathString matched, out PathString remaining) 354public PathString Add(PathString other) 383public bool Equals(PathString other) 394public bool Equals(PathString other, StringComparison comparisonType) 414return obj is PathString pathString && Equals(pathString); 432public static bool operator ==(PathString left, PathString right) 443public static bool operator !=(PathString left, PathString right) 453public static string operator +(string left, PathString right) 465public static string operator +(PathString left, string? right) 478public static PathString operator +(PathString left, PathString right) 489public static string operator +(PathString left, QueryString right) 498public static implicit operator PathString(string? s) 505public static implicit operator string(PathString path) 508internal static PathString ConvertFromString(string? s) 519? PathString.ConvertFromString(@string)
Microsoft.AspNetCore.Http.Abstractions.Microbenchmarks (4)
PathStringBenchmark.cs (4)
22var pathString = PathString.FromUriComponent(testPath); 30var pathString = PathString.FromUriComponent(testUri);
Microsoft.AspNetCore.Http.Abstractions.Tests (74)
PathStringTests.cs (72)
23Assert.Equal(default(PathString), PathString.Empty); 24Assert.Equal(default(PathString), PathString.Empty); 25Assert.True(PathString.Empty == default(PathString)); 26Assert.True(default(PathString) == PathString.Empty); 27Assert.True(PathString.Empty.Equals(default(PathString))); 28Assert.True(default(PathString).Equals(PathString.Empty)); 35var pathString = new PathString("/hello"); 38Assert.NotEqual(default(PathString), pathString); 45var pathString = new PathString("/hello"); 48Assert.NotEqual(pathString, PathString.Empty); 54Assert.Equal(PathString.Empty.GetHashCode(), default(PathString).GetHashCode()); 63var appPath = new PathString(appString); 64var concatPath = new PathString(concatString); 67var result = appPath.Add(concatPath); 83var appPath = new PathString(appString); 84var concatPath = new PathString(concatString); 87var result = appPath.Add(concatPath); 98var pathBase = new PathString("/base"); 99var path = new PathString("/path"); 121var source = new PathString(sourcePath); 122var test = new PathString(testPath); 137var source = new PathString(sourcePath); 138var test = new PathString(testPath); 153var source = new PathString(sourcePath); 154var test = new PathString(testPath); 156var result = source.StartsWithSegments(test, out var remaining); 169var source = new PathString(sourcePath); 170var test = new PathString(testPath); 172var result = source.StartsWithSegments(test, out var remaining); 190var source = new PathString(sourcePath); 191var test = new PathString(testPath); 211var source = new PathString(sourcePath); 212var test = new PathString(testPath); 232var source = new PathString(sourcePath); 233var test = new PathString(testPath); 235var result = source.StartsWithSegments(test, comparison, out var remaining); 253var source = new PathString(sourcePath); 254var test = new PathString(testPath); 256var result = source.StartsWithSegments(test, comparison, out var remaining); 284var path = new PathString(input); 292var converter = TypeDescriptor.GetConverter(typeof(PathString)); 293PathString result = (PathString)converter.ConvertFromInvariantString("/foo")!; 307PathString p1 = "/?"; 309PathString p2 = s1; 320var sut = PathString.FromUriComponent(input); 332var sut = PathString.FromUriComponent(uri); 342var sut = PathString.FromUriComponent(input); 353var sut = PathString.FromUriComponent(uri); 368var sut = PathString.FromUriComponent(input); 377var sut = PathString.FromUriComponent(input); 388var testString = new string('a', PathString.StackAllocThreshold + offset - path.Length); 389var sut = PathString.FromUriComponent(path + testString); 390Assert.Equal(PathString.StackAllocThreshold + offset, sut.Value!.Length); 400var testString = new string('a', PathString.StackAllocThreshold + offset); 401var sut = PathString.FromUriComponent(new Uri(localhost + testString)); 402Assert.Equal(PathString.StackAllocThreshold + offset + 1, sut.Value!.Length);
UsePathBaseExtensionsTests.cs (2)
222Assert.Equal(expectedPath, ((PathString?)requestContext.Items["test.Path"])!.Value.Value); 223Assert.Equal(expectedPathBase, ((PathString?)requestContext.Items["test.PathBase"])!.Value.Value);
Microsoft.AspNetCore.Http.Extensions (9)
UriHelper.cs (9)
31PathString pathBase = new PathString(), 32PathString path = new PathString(), 54PathString pathBase = new PathString(), 55PathString path = new PathString(), 109out PathString path, 146path = PathString.FromUriComponent(uri.Substring(searchIndex, limit - searchIndex)); 168pathBase: PathString.FromUriComponent(uri), 242/// Initializes the URI <see cref="string"/> for <see cref="BuildAbsolute(string, HostString, PathString, PathString, QueryString, FragmentString)"/>.
Microsoft.AspNetCore.Http.Extensions.Tests (5)
UriHelperTests.cs (5)
137var path = new PathString(); 154var path = new PathString("/index.html"); 161var resPath = new PathString(); 177var resPath = new PathString(); 189var resPath = new PathString();
Microsoft.AspNetCore.Http.Results (3)
src\Shared\ResultsHelpers\SharedUrlHelper.cs (3)
22var segment = new PathString(contentPath.Substring(1)); 23var applicationPath = httpContext.Request.PathBase; 25var path = applicationPath.Add(segment);
Microsoft.AspNetCore.Http.Results.Tests (4)
TestLinkGenerator.cs (4)
13public override string GetPathByAddress<TAddress>(HttpContext httpContext, TAddress address, RouteValueDictionary values, RouteValueDictionary ambientValues = null, PathString? pathBase = null, FragmentString fragment = default, LinkOptions options = null) 18public override string GetPathByAddress<TAddress>(TAddress address, RouteValueDictionary values, PathString pathBase = default, FragmentString fragment = default, LinkOptions options = null) 23public override string GetUriByAddress<TAddress>(HttpContext httpContext, TAddress address, RouteValueDictionary values, RouteValueDictionary ambientValues = null, string scheme = null, HostString? host = null, PathString? pathBase = null, FragmentString fragment = default, LinkOptions options = null) 26public override string GetUriByAddress<TAddress>(TAddress address, RouteValueDictionary values, string scheme, HostString host, PathString pathBase = default, FragmentString fragment = default, LinkOptions options = null)
Microsoft.AspNetCore.HttpOverrides (1)
ForwardedHeadersMiddleware.cs (1)
383request.PathBase = PathString.FromUriComponent(currentValues.Prefix);
Microsoft.AspNetCore.HttpOverrides.Tests (3)
ForwardedHeadersMiddlewareTest.cs (3)
962Assert.Equal(PathString.Empty, context.Request.PathBase); 1238Assert.Equal(PathString.Empty, context.Request.PathBase); 1285Assert.Equal(PathString.Empty, context.Request.PathBase);
Microsoft.AspNetCore.Identity.InMemory.Test (1)
FunctionalTest.cs (1)
305PathString remainder;
Microsoft.AspNetCore.Mvc.Core (17)
Routing\ControllerLinkGeneratorExtensions.cs (4)
46PathString? pathBase = default, 84PathString pathBase = default, 142PathString? pathBase = default, 194PathString pathBase = default,
Routing\PageLinkGeneratorExtensions.cs (4)
45PathString? pathBase = default, 87PathString pathBase = default, 143PathString? pathBase = default, 195PathString pathBase = default,
Routing\UrlHelperBase.cs (6)
131var pathBase = ActionContext.HttpContext.Request.PathBase; 304var segment = new PathString(contentPath.Substring(1)); 305var applicationPath = httpContext.Request.PathBase; 307var path = applicationPath.Add(segment); 415internal static void AppendPathAndFragment(StringBuilder builder, PathString pathBase, string virtualPath, string? fragment) 470var pathBase = ActionContext.HttpContext.Request.PathBase;
src\Shared\ResultsHelpers\SharedUrlHelper.cs (3)
22var segment = new PathString(contentPath.Substring(1)); 23var applicationPath = httpContext.Request.PathBase; 25var path = applicationPath.Add(segment);
Microsoft.AspNetCore.Mvc.Core.Test (1)
RequireHttpsAttributeTests.cs (1)
176requestContext.Request.Path = PathString.FromUriComponent(uri);
Microsoft.AspNetCore.Mvc.Razor (1)
Infrastructure\DefaultFileVersionProvider.cs (1)
36public string AddFileVersionToPath(PathString requestPathBase, string path)
Microsoft.AspNetCore.Mvc.TagHelpers (7)
GlobbingUrlBuilder.cs (3)
33public GlobbingUrlBuilder(IFileProvider fileProvider, IMemoryCache cache, PathString requestPathBase) 57public PathString RequestPathBase { get; } 159var relativePath = new PathString("/" + matchedPath.Path);
ImageTagHelper.cs (1)
144var pathBase = ViewContext.HttpContext.Request.PathBase;
LinkTagHelper.cs (1)
536var pathBase = ViewContext.HttpContext.Request.PathBase;
ResourceCollectionUtilities.cs (1)
14var pathBase = viewContext.HttpContext.Request.PathBase;
ScriptTagHelper.cs (1)
416var pathBase = ViewContext.HttpContext.Request.PathBase;
Microsoft.AspNetCore.Mvc.TagHelpers.Test (47)
DefaultFileVersionProviderTest.cs (12)
28var requestPath = GetRequestPathBase(); 48var requestPath = GetRequestPathBase(); 78var requestPath = GetRequestPathBase(); 103var requestPath = GetRequestPathBase(); 125var requestPath = GetRequestPathBase(); 149var requestPath = GetRequestPathBase("/wwwroot/"); 182var requestPath = GetRequestPathBase(); 203var requestPath = GetRequestPathBase(requestPathBase); 219var requestPath = GetRequestPathBase(); 239var requestPath = GetRequestPathBase(); 272var requestPath = GetRequestPathBase(requestPathBase); 333private static PathString GetRequestPathBase(string requestPathBase = null)
GlobbingUrlBuilderTest.cs (19)
22var requestPathBase = PathString.Empty; 38var requestPathBase = PathString.Empty; 210var requestPathBase = PathString.Empty; 230var requestPathBase = new PathString(pathBase); 252var requestPathBase = PathString.Empty; 282var requestPathBase = PathString.Empty; 340var requestPathBase = PathString.Empty; 364var requestPathBase = PathString.Empty; 392var requestPathBase = PathString.Empty; 418var requestPathBase = PathString.Empty;
LinkTagHelperTest.cs (10)
304PathString.Empty); 392PathString.Empty); 585PathString.Empty); 626PathString.Empty); 680PathString.Empty); 866PathString.Empty); 920PathString.Empty); 990PathString.Empty); 1033PathString.Empty); 1075PathString.Empty);
ScriptTagHelperTest.cs (6)
281PathString.Empty); 368PathString.Empty); 545PathString.Empty); 598PathString.Empty); 969PathString.Empty); 1007PathString.Empty);
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
IFileVersionProvider.cs (1)
19string AddFileVersionToPath(PathString requestPathBase, string path);
Microsoft.AspNetCore.Rewrite (18)
IISUrlRewrite\IISUrlRewriteRule.cs (2)
42var path = context.HttpContext.Request.Path; 44if (path == PathString.Empty)
RedirectRule.cs (2)
30var path = request.Path; 31var pathBase = request.PathBase;
RewriteMiddleware.cs (1)
64var originalPath = context.Request.Path;
RewriteRule.cs (7)
29var path = context.HttpContext.Request.Path; 31if (path == PathString.Empty) 59PathString pathString; 76request.Path = PathString.FromUriComponent(newPath); 80request.Path = PathString.FromUriComponent('/' + newPath); 90request.Path = PathString.FromUriComponent(result); 94request.Path = PathString.FromUriComponent('/' + result);
UrlActions\RedirectAction.cs (1)
33var pathBase = context.HttpContext.Request.PathBase;
UrlActions\RewriteAction.cs (5)
66PathString path; 98request.Path = PathString.FromUriComponent(path); 102request.Path = PathString.FromUriComponent('/' + path); 121request.Path = PathString.FromUriComponent(pattern); 125request.Path = PathString.FromUriComponent('/' + pattern);
Microsoft.AspNetCore.Rewrite.Tests (1)
IISUrlRewrite\ServerVariableTests.cs (1)
141context.Request.Path = PathString.FromUriComponent("/foo");
Microsoft.AspNetCore.Routing (41)
DefaultLinkGenerator.cs (8)
74PathString? pathBase = default, 99PathString pathBase = default, 126PathString? pathBase = default, 154PathString pathBase = default, 204PathString pathBase, 240PathString pathBase, 286out (PathString path, QueryString query) result) 354public static void TemplateSucceeded(ILogger logger, RouteEndpoint endpoint, PathString path, QueryString query)
DefaultLinkParser.cs (4)
48public override RouteValueDictionary? ParsePathByAddress<TAddress>(TAddress address, PathString path) 119internal bool TryParse(RouteEndpoint endpoint, PathString path, [NotNullWhen(true)] out RouteValueDictionary? values) 187public static void PathParsingSucceeded(ILogger logger, PathString path, Endpoint endpoint) 199public static void PathParsingFailed(ILogger logger, PathString path, IEnumerable<Endpoint> endpoints)
LinkGeneratorEndpointNameAddressExtensions.cs (8)
37PathString? pathBase = default, 77PathString? pathBase = default, 113PathString pathBase = default, 141PathString pathBase = default, 190PathString? pathBase = default, 249PathString? pathBase = default, 302PathString pathBase = default, 351PathString pathBase = default,
LinkGeneratorRouteValuesAddressExtensions.cs (8)
37PathString? pathBase = default, 77PathString? pathBase = default, 113PathString pathBase = default, 141PathString pathBase = default, 190PathString? pathBase = default, 249PathString? pathBase = default, 302PathString pathBase = default, 345PathString pathBase = default,
LinkParser.cs (2)
26/// <see cref="ParsePathByAddress{TAddress}(TAddress, PathString)"/> will attempt to first resolve 35public abstract RouteValueDictionary? ParsePathByAddress<TAddress>(TAddress address, PathString path);
LinkParserEndpointNameAddressExtensions.cs (2)
26/// <see cref="ParsePathByEndpointName(LinkParser, string, PathString)"/> will attempt to first resolve 38PathString path)
PathTokenizer.cs (1)
22public PathTokenizer(PathString path)
Patterns\RoutePatternMatcher.cs (1)
63public bool TryMatch(PathString path, RouteValueDictionary values)
RouteBase.cs (1)
113var requestPath = context.HttpContext.Request.Path;
Template\TemplateBinder.cs (1)
474out (PathString path, QueryString query) result)
Template\TemplateMatcher.cs (2)
78/// <param name="path">A <see cref="PathString"/> representing the route to match.</param> 81public bool TryMatch(PathString path, RouteValueDictionary values)
UriBuildingContext.cs (3)
241public PathString ToPathString() 243PathString pathString; 262pathString = PathString.Empty;
Microsoft.AspNetCore.Routing.Abstractions (4)
LinkGenerator.cs (4)
51PathString? pathBase = default, 72PathString pathBase = default, 116PathString? pathBase = default, 152PathString pathBase = default,
Microsoft.AspNetCore.Routing.Tests (1)
DefaultLinkGeneratorProcessTemplateTest.cs (1)
370Assert.Equal("/home/п", PathString.FromUriComponent(result.path.ToUriComponent()).Value);
Microsoft.AspNetCore.Server.HttpSys (2)
UrlPrefixCollection.cs (2)
84var originalPathString = new PathString(originalPath); 96&& originalPathString.StartsWithSegments(new PathString(prefix.PathWithoutTrailingSlash), StringComparison.OrdinalIgnoreCase, out var remainder)
Microsoft.AspNetCore.Server.IISIntegration (3)
IISMiddleware.cs (1)
28private static readonly PathString ANCMRequestPath = new PathString("/iisintegration");
IISSetupFilter.cs (2)
13private readonly PathString _pathBase; 16internal IISSetupFilter(string pairingToken, PathString pathBase, bool isWebsocketsSupported)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
InMemoryTransportBenchmark.cs (1)
239private static readonly PathString _path = new PathString("/plaintext");
NamedPipesTransportBenchmark.cs (1)
137private static readonly PathString _path = new PathString("/plaintext");
Microsoft.AspNetCore.SpaServices.Extensions (2)
SpaOptions.cs (2)
15private PathString _defaultPage = "/index.html"; 42public PathString DefaultPage
Microsoft.AspNetCore.StaticFiles (23)
DefaultFilesMiddleware.cs (2)
20private readonly PathString _matchUrl; 53&& Helpers.TryMatchPath(context, _matchUrl, forDirectory: true, subpath: out var subpath))
DirectoryBrowserMiddleware.cs (3)
19private readonly PathString _matchUrl; 66&& Helpers.TryMatchPath(context, _matchUrl, forDirectory: true, subpath: out var subpath) 83private bool TryGetDirectoryInfo(PathString subpath, out IDirectoryContents contents)
Helpers.cs (5)
27internal static bool PathEndsInSlash(PathString path) 32internal static string GetPathValueWithSlash(PathString path) 49internal static bool TryMatchPath(HttpContext context, PathString matchUrl, bool forDirectory, out PathString subpath) 51var path = context.Request.Path;
HtmlDirectoryFormatter.cs (1)
48PathString requestPath = context.Request.PathBase + context.Request.Path;
Infrastructure\SharedOptions.cs (3)
14private PathString _requestPath; 21RequestPath = PathString.Empty; 27public PathString RequestPath
Infrastructure\SharedOptionsBase.cs (1)
35public PathString RequestPath
StaticFileContext.cs (2)
34private readonly PathString _subPath; 44public StaticFileContext(HttpContext context, StaticFileOptions options, ILogger logger, IFileProvider fileProvider, string? contentType, PathString subPath)
StaticFileMiddleware.cs (6)
19private readonly PathString _matchUrl; 68else if (!ValidatePath(context, _matchUrl, out var subPath)) 93internal static bool ValidatePath(HttpContext context, PathString matchUrl, out PathString subPath) => Helpers.TryMatchPath(context, matchUrl, forDirectory: false, out subPath); 95internal static bool LookupContentType(IContentTypeProvider contentTypeProvider, StaticFileOptions options, PathString subPath, out string? contentType) 111private Task TryServeStaticFile(HttpContext context, string? contentType, PathString subPath)
Microsoft.AspNetCore.StaticFiles.Tests (11)
StaticFileContextTest.cs (11)
21var pathString = PathString.Empty; 22var validateResult = StaticFileMiddleware.ValidatePath(httpContext, pathString, out var subPath); 45var pathString = new PathString("/test"); 48var validateResult = StaticFileMiddleware.ValidatePath(httpContext, pathString, out var subPath); 71var pathString = new PathString("/test"); 76var validateResult = StaticFileMiddleware.ValidatePath(httpContext, pathString, out var subPath); 100var pathString = new PathString("/test"); 105var validateResult = StaticFileMiddleware.ValidatePath(httpContext, pathString, out var subPath); 127var pathString = new PathString("/test"); 133var validateResult = StaticFileMiddleware.ValidatePath(httpContext, pathString, out var subPath);
Microsoft.AspNetCore.TestHost (18)
ClientHandler.cs (5)
24private readonly PathString _pathBase; 32internal ClientHandler(PathString pathBase, ApplicationWrapper application, Action<HttpContext>? additionalContextConfiguration = null) 180req.Path = PathString.FromUriComponent(request.RequestUri); 181req.PathBase = PathString.Empty; 182if (req.Path.StartsWithSegments(_pathBase, out var remainder))
TestServer.cs (8)
146private PathString PathBase => BaseAddress == null ? PathString.Empty : PathString.FromUriComponent(BaseAddress); 189var pathBase = BaseAddress == null ? PathString.Empty : PathString.FromUriComponent(BaseAddress); 221var pathBase = PathString.FromUriComponent(BaseAddress);
WebSocketClient.cs (5)
20private readonly PathString _pathBase; 22internal WebSocketClient(PathString pathBase, ApplicationWrapper application) 71request.Path = PathString.FromUriComponent(uri); 72request.PathBase = PathString.Empty; 73if (request.Path.StartsWithSegments(_pathBase, out var remainder))
Microsoft.AspNetCore.TestHost.Tests (18)
ClientHandlerTests.cs (18)
202var handler = new ClientHandler(PathString.Empty, new DummyApplication(async context => 265var handler = new ClientHandler(PathString.Empty, new InspectingApplication(features => 280var handler = new ClientHandler(PathString.Empty, new InspectingApplication(features => 300var handler = new ClientHandler(PathString.Empty, new DummyApplication(async context => 338PathString.Empty, 351var handler = new ClientHandler(PathString.Empty, new DummyApplication(async context => 373var handler = new ClientHandler(PathString.Empty, new DummyApplication(context => 387var handler = new ClientHandler(PathString.Empty, new DummyApplication(context => 406var handler = new ClientHandler(PathString.Empty, new DummyApplication(async context => 425var handler = new ClientHandler(PathString.Empty, new DummyApplication(async context => 444var handler = new ClientHandler(PathString.Empty, new DummyApplication(async context => 466var handler = new ClientHandler(PathString.Empty, new DummyApplication(async context => 489var handler = new ClientHandler(PathString.Empty, new DummyApplication(context => 511var handler = new ClientHandler(PathString.Empty, new DummyApplication(context => 524var handler = new ClientHandler(PathString.Empty, new DummyApplication(async context => 543var handler = new ClientHandler(PathString.Empty, new DummyApplication(context => 559var handler = new ClientHandler(PathString.Empty, new DummyApplication(context => 575var handler = new ClientHandler(PathString.Empty, new DummyApplication(async context =>