1 write to Value
Microsoft.AspNetCore.Http.Abstractions (1)
PathString.cs (1)
43Value = value;
203 references to Value
AzureAppServicesHostingStartupSample (2)
Startup.cs (2)
23await context.Response.WriteAsync("PathBase: " + context.Request.PathBase.Value + Environment.NewLine); 24await context.Response.WriteAsync("Path: " + context.Request.Path.Value + Environment.NewLine);
AzureAppServicesSample (2)
Startup.cs (2)
34await context.Response.WriteAsync("PathBase: " + context.Request.PathBase.Value + Environment.NewLine); 35await context.Response.WriteAsync("Path: " + context.Request.Path.Value + Environment.NewLine);
BasicWebSite (1)
src\Mvc\test\WebSites\Common\TestResponseGenerator.cs (1)
43actualUrl = _actionContext.HttpContext.Request.Path.Value,
GenericHostWebSite (1)
src\Mvc\test\WebSites\Common\TestResponseGenerator.cs (1)
43actualUrl = _actionContext.HttpContext.Request.Path.Value,
IISSample (2)
Startup.cs (2)
48await context.Response.WriteAsync("PathBase: " + context.Request.PathBase.Value + Environment.NewLine); 49await context.Response.WriteAsync("Path: " + context.Request.Path.Value + Environment.NewLine);
InMemory.FunctionalTests (14)
Http2\Http2StreamTests.cs (2)
360context.Response.Headers["path"] = context.Request.Path.Value; 406Assert.Equal(expected, context.Request.Path.Value);
Http2\Http2TestBase.cs (3)
193_receivedRequestFields.Path = context.Request.Path.Value; 220_receivedRequestFields.Path = context.Request.Path.Value; 334var expectedBytes = int.Parse(context.Request.Path.Value.Substring(1), CultureInfo.InvariantCulture);
Http2\Http2WebSocketTests.cs (3)
28Assert.Equal("/chat", context.Request.Path.Value); 90Assert.Equal("/chat", context.Request.Path.Value); 166Assert.Equal("/chat", context.Request.Path.Value);
Http3\Http3StreamTests.cs (2)
208context.Response.Headers["path"] = context.Request.Path.Value; 243Assert.Equal(expected, context.Request.Path.Value);
Http3\Http3TestBase.cs (1)
76var expectedBytes = int.Parse(context.Request.Path.Value.Substring(1), CultureInfo.InvariantCulture);
RequestTargetProcessingTests.cs (3)
24Assert.Equal("/\u0041\u030A/B/\u0041\u030A", context.Request.Path.Value); 102Assert.Empty(context.Request.Path.Value); 103Assert.Empty(context.Request.PathBase.Value);
InProcessWebSite (8)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (8)
269return ctx.Response.WriteAsync($"PathBase: {ctx.Request.PathBase.Value}; Path: {ctx.Request.Path.Value}"); 403if (ctx.Request.Path.Value.StartsWith("/Path", StringComparison.Ordinal)) 405await ctx.Response.WriteAsync(ctx.Request.Path.Value); 408if (ctx.Request.Path.Value.StartsWith("/Query", StringComparison.Ordinal)) 988ctx.Request.Headers.ContentLength = ctx.Request.Path.Value.Length; 989return ctx.Response.WriteAsync(ctx.Request.Path.Value); 1070public Task Path(HttpContext ctx) => ctx.Response.WriteAsync(ctx.Request.Path.Value);
Interop.FunctionalTests (1)
HttpClientHttp2InteropTests.cs (1)
1583.Configure(app => app.Run(context => context.Response.WriteAsync(context.Request.Path.Value)));
LargeResponseApp (1)
Startup.cs (1)
26if (!path.HasValue || !int.TryParse(path.Value.AsSpan(1), out var numChunks))
LocalizationSample (1)
Startup.cs (1)
34if (context.Request.Path.Value.EndsWith("favicon.ico", StringComparison.Ordinal))
Microsoft.AspNetCore.Authentication.OpenIdConnect (4)
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);
Microsoft.AspNetCore.Authentication.Test (9)
CookieTests.cs (1)
1854var ticket = await context.AuthenticateAsync(remainder.Value.Substring(1));
DynamicSchemeTests.cs (4)
143var name = remainder.Value.Substring(1); 150var name = (remainder.Value.Length > 0) ? remainder.Value.Substring(1) : null; 156var name = remainder.Value.Substring(1);
GoogleTests.cs (2)
424Assert.Equal("/access-denied", ctx.AccessDeniedPath.Value); 455Assert.Null(ctx.AccessDeniedPath.Value);
PolicyTests.cs (2)
476var name = (remainder.Value.Length > 0) ? remainder.Value.Substring(1) : null;
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
ComponentsWebAssemblyApplicationBuilderExtensions.cs (2)
110var fileExtension = Path.GetExtension(requestPath.Value); 120var originalPath = Path.GetFileNameWithoutExtension(requestPath.Value);
Microsoft.AspNetCore.Diagnostics (3)
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (1)
159Path = originalPath.Value!,
StatusCodePage\StatusCodePagesExtensions.cs (2)
183OriginalPathBase = context.HttpContext.Request.PathBase.Value!, 184OriginalPath = originalPath.Value!,
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (1)
Views\DatabaseErrorPage.Designer.cs (1)
414Write(JavaScriptEncode(Model.PathBase.Add(Model.Options.MigrationsEndPointPath).Value!));
Microsoft.AspNetCore.Diagnostics.Middleware (2)
Logging\HttpLoggingRedactionInterceptor.cs (2)
68if (_excludePathStartsWith.Length != 0 && ShouldExcludePath(context.Request.Path.Value!)) 121path = request.Path.Value!;
Microsoft.AspNetCore.Hosting (8)
Internal\HostingRequestFinishedLog.cs (4)
438 => new KeyValuePair<string, object?>(nameof(request.PathBase), request.PathBase.Value), 449 => new KeyValuePair<string, object?>(nameof(request.Path), request.Path.Value), 66_cachedToString = $"Request finished {request.Protocol} {request.Method} {request.Scheme}://{request.Host.Value}{request.PathBase.Value}{request.Path.Value}{request.QueryString.Value} - {response.StatusCode.ToString(CultureInfo.InvariantCulture)} {ValueOrEmptyMarker(response.ContentLength)} {EscapedValueOrEmptyMarker(response.ContentType)} {Elapsed.TotalMilliseconds.ToString("0.0000", CultureInfo.InvariantCulture)}ms";
Internal\HostingRequestStartingLog.cs (4)
316 => new KeyValuePair<string, object?>(nameof(_request.PathBase), _request.PathBase.Value), 327 => new KeyValuePair<string, object?>(nameof(_request.Path), _request.Path.Value), 48_cachedToString = $"Request starting {request.Protocol} {request.Method} {request.Scheme}://{request.Host.Value}{request.PathBase.Value}{request.Path.Value}{request.QueryString.Value} - {EscapedValueOrEmptyMarker(request.ContentType)} {ValueOrEmptyMarker(request.ContentLength)}";
Microsoft.AspNetCore.Http (4)
Internal\DefaultHttpRequest.cs (2)
70set { HttpRequestFeature.PathBase = value.Value ?? string.Empty; } 76set { HttpRequestFeature.Path = value.Value ?? string.Empty; }
src\Shared\Debugger\HttpContextDebugFormatter.cs (2)
114sb.Append(CultureInfo.InvariantCulture, $"{scheme}://{host}{request.PathBase.Value}{request.Path.Value}{(includeQueryString ? request.QueryString.Value : string.Empty)}");
Microsoft.AspNetCore.Http.Abstractions (19)
Extensions\MapExtensions.cs (1)
54if (pathMatch.HasValue && pathMatch.Value!.EndsWith('/'))
Extensions\UsePathBaseExtensions.cs (1)
26pathBase = new PathString(pathBase.Value?.TrimEnd('/'));
PathString.cs (17)
54[MemberNotNullWhen(true, nameof(Value))] 57get { return !string.IsNullOrEmpty(Value); } 75var value = Value; 241var value1 = Value ?? string.Empty; 242var value2 = other.Value ?? string.Empty; 284var value1 = Value ?? string.Empty; 285var value2 = other.Value ?? string.Empty; 334var value1 = Value ?? string.Empty; 335var value2 = other.Value ?? string.Empty; 358Value[^1] == '/') 362var combined = string.Concat(Value.AsSpan(), other.Value.AsSpan(1)); 366return new PathString(Value + other.Value); 400return string.Equals(Value, other.Value, comparisonType); 423return (HasValue ? StringComparer.OrdinalIgnoreCase.GetHashCode(Value) : 0);
Microsoft.AspNetCore.Http.Abstractions.Microbenchmarks (2)
PathStringBenchmark.cs (2)
23return pathString.Value; 31return pathString.Value;
Microsoft.AspNetCore.Http.Abstractions.Tests (28)
MapPathMiddlewareTests.cs (16)
15context.Items["test.PathBase"] = context.Request.PathBase.Value; 16context.Items["test.Path"] = context.Request.Path.Value; 63Assert.Equal(basePath, context.Request.PathBase.Value); 64Assert.Equal(requestPath, context.Request.Path.Value); 152Assert.Equal(basePath, context.Request.PathBase.Value); 153Assert.Equal(requestPath, context.Request.Path.Value); 174Assert.Equal(basePath, context.Request.PathBase.Value); 175Assert.Equal(requestPath, context.Request.Path.Value); 196Assert.Equal(string.Empty, context.Request.PathBase.Value); 197Assert.Equal("/route1/subroute1", context.Request.Path.Value); 202Assert.Equal(string.Empty, context.Request.PathBase.Value); 203Assert.Equal("/route2", context.Request.Path.Value); 208Assert.Equal(string.Empty, context.Request.PathBase.Value); 209Assert.Equal("/route2/subroute2", context.Request.Path.Value); 214Assert.Equal(string.Empty, context.Request.PathBase.Value); 215Assert.Equal("/route2/subroute2/subsub2", context.Request.Path.Value);
PathStringTests.cs (8)
90Assert.Equal(expected, result.Value); 321Assert.Equal(input, sut.Value); 333Assert.Equal(input, sut.Value); 343Assert.Equal(expected, sut.Value); 354Assert.Equal(expected, sut.Value); 378Assert.Equal(expected, sut.Value); 390Assert.Equal(PathString.StackAllocThreshold + offset, sut.Value!.Length); 402Assert.Equal(PathString.StackAllocThreshold + offset + 1, sut.Value!.Length);
UsePathBaseExtensionsTests.cs (4)
222Assert.Equal(expectedPath, ((PathString?)requestContext.Items["test.Path"])!.Value.Value); 223Assert.Equal(expectedPathBase, ((PathString?)requestContext.Items["test.PathBase"])!.Value.Value); 226Assert.Equal(pathBase, requestContext.Request.PathBase.Value); 227Assert.Equal(requestPath, requestContext.Request.Path.Value);
Microsoft.AspNetCore.Http.Extensions (2)
UriHelper.cs (2)
209var pathBase = request.PathBase.Value ?? string.Empty; 210var path = request.Path.Value ?? string.Empty;
Microsoft.AspNetCore.Http.Results (1)
src\Shared\ResultsHelpers\SharedUrlHelper.cs (1)
27return path.Value;
Microsoft.AspNetCore.HttpOverrides.Tests (2)
ForwardedHeadersMiddlewareTest.cs (2)
1160Assert.Equal(expectedUnescapedPathBase, context.Request.PathBase.Value); 1203Assert.Equal(expectedUnescapedPathBase, context.Request.PathBase.Value);
Microsoft.AspNetCore.Identity.InMemory.Test (2)
FunctionalTest.cs (2)
337var isPersistent = bool.Parse(remainder.Value.AsSpan(1)); 364var auth = await context.AuthenticateAsync(remainder.Value.Substring(1));
Microsoft.AspNetCore.Localization.Tests (1)
CustomRequestCultureProviderTest.cs (1)
67var segments = context.Request.Path.Value.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
Microsoft.AspNetCore.Mvc.Core (5)
Routing\UrlHelperBase.cs (4)
309return path.Value; 437builder.Append(pathBase.Value); 441builder.Append(pathBase.Value); 443if (pathBase.Value.EndsWith('/'))
src\Shared\ResultsHelpers\SharedUrlHelper.cs (1)
27return path.Value;
Microsoft.AspNetCore.Mvc.Razor (2)
Infrastructure\DefaultFileVersionProvider.cs (2)
65resolvedPath.StartsWith(requestPathBase.Value, StringComparison.OrdinalIgnoreCase)) 67var requestPathBaseRelativePath = resolvedPath.Substring(requestPathBase.Value.Length);
Microsoft.AspNetCore.Mvc.TagHelpers (4)
ResourceCollectionUtilities.cs (4)
34var length = pathBase.Value.EndsWith('/') ? pathBase.Value.Length : pathBase.Value.Length + 1; 45if (pathBase.Value.EndsWith('/'))
Microsoft.AspNetCore.Owin.Tests (2)
OwinEnvironmentTests.cs (2)
87Assert.Equal("/path", context.Request.Path.Value); 88Assert.Equal("/pathBase", context.Request.PathBase.Value);
Microsoft.AspNetCore.ResponseCaching (4)
ResponseCachingKeyProvider.cs (4)
56.Append(request.PathBase.Value) 57.Append(request.Path.Value); 62.AppendUpperInvariant(request.PathBase.Value) 63.AppendUpperInvariant(request.Path.Value);
Microsoft.AspNetCore.Rewrite (2)
RedirectRule.cs (1)
55encodedPath = pathBase.HasValue ? pathBase.Value : "/";
UrlActions\RedirectAction.cs (1)
42response.Headers.Location = pathBase.HasValue ? pathBase.Value : "/";
Microsoft.AspNetCore.Routing (5)
DefaultLinkGenerator.cs (1)
355=> TemplateSucceeded(logger, endpoint.RoutePattern.RawText, endpoint.DisplayName, path.Value, query.Value);
DefaultLinkParser.cs (2)
192PathParsingSucceeded(logger, endpoint.DisplayName, path.Value); 204PathParsingFailed(logger, endpoints.Select(e => e.DisplayName), path.Value);
Matching\DfaMatcher.cs (1)
42var path = httpContext.Request.Path.Value!;
PathTokenizer.cs (1)
24_path = path.Value;
Microsoft.AspNetCore.Routing.Microbenchmarks (3)
Matching\TrivialMatcher.cs (1)
27var path = httpContext.Request.Path.Value;
src\Http\Routing\test\UnitTests\Matching\BarebonesMatcher.cs (2)
24var path = httpContext.Request.Path.Value; 115if (TryMatch(httpContext.Request.Path.Value))
Microsoft.AspNetCore.Routing.Tests (4)
DefaultLinkGeneratorProcessTemplateTest.cs (1)
370Assert.Equal("/home/п", PathString.FromUriComponent(result.path.ToUriComponent()).Value);
Matching\BarebonesMatcher.cs (2)
24var path = httpContext.Request.Path.Value; 115if (TryMatch(httpContext.Request.Path.Value))
UriBuildingContextTest.cs (1)
96Assert.Equal(expected, uriBuilldingContext.ToPathString().Value);
Microsoft.AspNetCore.Server.HttpSys (2)
UrlPrefixCollection.cs (2)
97&& (!found || remainder.Value!.Length < remainingPath!.Length)) // Longest match 101remainingPath = remainder.Value;
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
ResponseCachingTests.cs (1)
431var status = int.Parse(httpContext.Request.Path.Value.Substring(1), CultureInfo.InvariantCulture);
Microsoft.AspNetCore.Server.IISIntegration.Tests (2)
IISMiddlewareTests.cs (2)
370requestPathBase = context.Request.PathBase.Value; 371requestPath = context.Request.Path.Value;
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (1)
Startup.cs (1)
86if (context.Request.Path.Value.EndsWith("/negotiate", StringComparison.Ordinal))
Microsoft.AspNetCore.SpaServices.Extensions (1)
SpaOptions.cs (1)
47ArgumentException.ThrowIfNullOrEmpty(value.Value);
Microsoft.AspNetCore.StaticFiles (12)
DefaultFilesMiddleware.cs (2)
56var dirContents = _fileProvider.GetDirectoryContents(subpath.Value!); 63var file = _fileProvider.GetFileInfo(subpath.Value + defaultFile);
DirectoryBrowserMiddleware.cs (1)
86contents = _fileProvider.GetDirectoryContents(subpath.Value!);
Helpers.cs (3)
29return path.HasValue && path.Value!.EndsWith("/", StringComparison.Ordinal); 36return path.Value + "/"; 38return path.Value!;
HtmlDirectoryFormatter.cs (2)
61<title>{0} {1}</title>", HtmlEncode(Resources.HtmlDir_IndexOf), HtmlEncode(requestPath.Value!)); 106foreach (var segment in requestPath.Value!.Split('/', StringSplitOptions.RemoveEmptyEntries))
Infrastructure\SharedOptions.cs (1)
32if (value.HasValue && value.Value!.EndsWith('/'))
StaticFileContext.cs (2)
46if (subPath.Value == null) 111public string SubPath => _subPath.Value!;
StaticFileMiddleware.cs (1)
97if (contentTypeProvider.TryGetContentType(subPath.Value!, out contentType))
Microsoft.AspNetCore.StaticFiles.Tests (5)
DefaultFilesMiddlewareTests.cs (5)
70app.Run(context => context.Response.WriteAsync(context.Request.Path.Value)); 95return context.Response.WriteAsync(context.Request.Path.Value); 112app.Run(context => context.Response.WriteAsync(context.Request.Path.Value)); 152app.Run(context => context.Response.WriteAsync(context.Request.Path.Value)); 218app.Run(context => context.Response.WriteAsync(context.Request.Path.Value));
Microsoft.AspNetCore.TestHost (6)
ClientHandler.cs (2)
38if (pathBase.HasValue && pathBase.Value.EndsWith('/')) 40pathBase = new PathString(pathBase.Value[..^1]); // All but the last character
TestServer.cs (2)
222if (pathBase.HasValue && pathBase.Value.EndsWith('/')) 224pathBase = new PathString(pathBase.Value[..^1]); // All but the last character.
WebSocketClient.cs (2)
27if (pathBase.HasValue && pathBase.Value.EndsWith('/')) 29pathBase = new PathString(pathBase.Value[..^1]); // All but the last character.
Microsoft.AspNetCore.TestHost.Tests (12)
ClientHandlerTests.cs (4)
53Assert.Equal("/A/Path", context.Request.PathBase.Value); 54Assert.Equal("/and/file.txt", context.Request.Path.Value); 100Assert.Equal("", context.Request.PathBase.Value); 101Assert.Equal("/", context.Request.Path.Value);
HttpContextBuilderTests.cs (4)
35Assert.Equal("/A/Path", context.Request.PathBase.Value); 36Assert.Equal("/and/file.txt", context.Request.Path.Value); 73Assert.Equal("", context.Request.PathBase.Value); 74Assert.Equal("/", context.Request.Path.Value);
TestClientTests.cs (4)
47Assert.Equal("", ctx.Request.PathBase.Value); 48Assert.Equal("/", ctx.Request.Path.Value); 69Assert.Equal("", ctx.Request.PathBase.Value); 70Assert.Equal("/", ctx.Request.Path.Value);
Mvc.RoutingWebSite (1)
src\Mvc\test\WebSites\Common\TestResponseGenerator.cs (1)
43actualUrl = _actionContext.HttpContext.Request.Path.Value,
NativeIISSample (2)
Startup.cs (2)
42await context.Response.WriteAsync("PathBase: " + context.Request.PathBase.Value + Environment.NewLine); 43await context.Response.WriteAsync("Path: " + context.Request.Path.Value + Environment.NewLine);
ServerComparison.TestSites (1)
StartupResponseCompression.cs (1)
48if (context.Request.Path.Value == "/")
SignalR.Client.FunctionalTestApp (1)
Startup.cs (1)
179if (context.Request.Path.Value.Contains("/negotiate"))
VersioningWebSite (1)
src\Mvc\test\WebSites\Common\TestResponseGenerator.cs (1)
43actualUrl = _actionContext.HttpContext.Request.Path.Value,
WebTransportInteractiveSampleApp (1)
Program.cs (1)
47if (context.Request.Path.Value?.Equals("/certificate.js") ?? false)