1 override of Scheme
Microsoft.AspNetCore.Http (1)
Internal\DefaultHttpRequest.cs (1)
103public override string Scheme
61 writes to Scheme
Aspire.Dashboard.Tests (1)
BrowserSecurityHeadersMiddlewareTests.cs (1)
55httpContext.Request.Scheme = scheme;
InProcessWebSite (1)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (1)
281ctx.Request.Scheme = "test";
Microsoft.AspNetCore.Components.Endpoints.Tests (4)
EndpointHtmlRendererTest.cs (3)
758ctx.Request.Scheme = "http"; 789ctx.Request.Scheme = "http"; 1657context.Request.Scheme = "http";
RazorComponentResultTest.cs (1)
472result.Request.Scheme = "https";
Microsoft.AspNetCore.Hosting.Tests (5)
HostingApplicationDiagnosticsTests.cs (5)
241c.Request.Scheme = "http"; 300c.Request.Scheme = "http"; 360c.Request.Scheme = "http"; 415c.Request.Scheme = "http"; 1050c.Request.Scheme = "http";
Microsoft.AspNetCore.Http.Extensions.Tests (2)
UriHelperTests.cs (2)
87request.Scheme = "http"; 102request.Scheme = "http";
Microsoft.AspNetCore.Http.Tests (6)
ApplicationBuilderTests.cs (1)
91httpContext.Request.Scheme = "https";
Internal\DefaultHttpRequestTests.cs (5)
128request.Scheme = "ftp"; 130request.Scheme = "HTTPS"; 303context.Request.Scheme = "http"; 317context.Request.Scheme = "http"; 331context.Request.Scheme = "http";
Microsoft.AspNetCore.HttpLogging.Tests (2)
HttpLoggingMiddlewareTests.cs (2)
1250httpContext.Request.Scheme = "http"; 1958httpContext.Request.Scheme = "http";
Microsoft.AspNetCore.HttpOverrides (1)
ForwardedHeadersMiddleware.cs (1)
342request.Scheme = currentValues.Scheme;
Microsoft.AspNetCore.Mvc.Core.Test (16)
RequireHttpsAttributeTests.cs (6)
20requestContext.Request.Scheme = "https"; 71requestContext.Request.Scheme = "http"; 114requestContext.Request.Scheme = "http"; 134requestContext.Request.Scheme = "http"; 173requestContext.Request.Scheme = "http"; 201requestContext.Request.Scheme = "http";
Routing\ControllerLinkGeneratorExtensionsTest.cs (1)
177httpContext.Request.Scheme = "http";
Routing\PageLinkGeneratorExtensionsTest.cs (1)
147httpContext.Request.Scheme = "http";
Routing\UrlHelperBaseTest.cs (1)
127context.Request.Scheme = protocol;
Routing\UrlHelperExtensionsTest.cs (6)
613Scheme = expectedProtocol, 648Scheme = "http://", 683Scheme = expectedProtocol, 721Scheme = expectedProtocol, 769Scheme = "http://", 817Scheme = expectedProtocol,
Routing\UrlHelperTestBase.cs (1)
1154context.Request.Scheme = protocol;
Microsoft.AspNetCore.OutputCaching.Tests (2)
OutputCacheKeyProviderTests.cs (2)
22context.HttpContext.Request.Scheme = "https"; 39context.HttpContext.Request.Scheme = "https";
Microsoft.AspNetCore.Owin.Tests (1)
OwinEnvironmentTests.cs (1)
30context.Request.Scheme = "http";
Microsoft.AspNetCore.Rewrite (2)
RewriteRule.cs (1)
63request.Scheme = scheme;
UrlActions\RewriteAction.cs (1)
86request.Scheme = scheme;
Microsoft.AspNetCore.Rewrite.Tests (5)
IISUrlRewrite\ServerVariableTests.cs (1)
139context.Request.Scheme = "http";
PatternSegments\IsHttpsModSegmentTests.cs (1)
19context.HttpContext.Request.Scheme = input;
PatternSegments\IsHttpsSegmentTests.cs (1)
19context.HttpContext.Request.Scheme = input;
PatternSegments\SchemeSegmentTests.cs (1)
17context.HttpContext.Request.Scheme = "http";
PatternSegments\UrlSegmentTests.cs (1)
29httpContext.Request.Scheme = scheme;
Microsoft.AspNetCore.Routing.Tests (10)
DefaultLinkGeneratorTest.cs (6)
139httpContext.Request.Scheme = "http"; 272httpContext.Request.Scheme = "http"; 414httpContext.Request.Scheme = "http"; 439httpContext.Request.Scheme = "http"; 463httpContext.Request.Scheme = "http"; 510httpContext.Request.Scheme = "http";
LinkGeneratorEndpointNameExtensionsTest.cs (1)
128httpContext.Request.Scheme = "http";
LinkGeneratorRouteValuesAddressExtensionsTest.cs (2)
150httpContext.Request.Scheme = "http"; 182httpContext.Request.Scheme = "http";
Matching\HostMatcherPolicyIntegrationTestBase.cs (1)
395httpContext.Request.Scheme = scheme;
Microsoft.AspNetCore.TestHost (3)
ClientHandler.cs (1)
116req.Scheme = request.RequestUri!.Scheme;
TestServer.cs (1)
215request.Scheme = BaseAddress.Scheme;
WebSocketClient.cs (1)
64request.Scheme = scheme;
126 references to Scheme
AzureAppServicesHostingStartupSample (1)
Startup.cs (1)
21await context.Response.WriteAsync("Scheme: " + context.Request.Scheme + Environment.NewLine);
AzureAppServicesSample (1)
Startup.cs (1)
32await context.Response.WriteAsync("Scheme: " + context.Request.Scheme + Environment.NewLine);
BasicWebSite (1)
StartupWithoutEndpointRouting.cs (1)
67client.BaseAddress = new Uri($"{httpContext.Request.Scheme}://{httpContext.Request.Host}");
HeaderPropagationSample (1)
Startup.cs (1)
75var uri = UriHelper.BuildAbsolute(context.Request.Scheme, context.Request.Host, context.Request.PathBase, "/forwarded");
HttpOverridesSample (1)
Startup.cs (1)
26await context.Response.WriteAsync($"Scheme: {context.Request.Scheme}\r\n");
Identity.DefaultUI.WebSite (1)
Services\ContosoAuthenticationHandler.cs (1)
27var uri = $"{Request.Scheme}://{Request.Host}{Request.PathBase}{Options.RemoteLoginPath}";
Identity.ExternalClaims (3)
Pages\Account\ForgotPassword.cshtml.cs (1)
51var callbackUrl = Url.ResetPasswordCallbackLink(user.Id, code, Request.Scheme);
Pages\Account\Manage\Index.cshtml.cs (1)
124var callbackUrl = Url.EmailConfirmationLink(user.Id, code, Request.Scheme);
Pages\Account\Register.cshtml.cs (1)
78var callbackUrl = Url.EmailConfirmationLink(user.Id, code, Request.Scheme);
IdentitySample.DefaultUI (1)
Areas\Identity\Pages\Account\Register.cshtml.cs (1)
100protocol: Request.Scheme);
IISSample (1)
Startup.cs (1)
46await context.Response.WriteAsync("Scheme: " + context.Request.Scheme + Environment.NewLine);
InMemory.FunctionalTests (8)
Http2\Http2StreamTests.cs (1)
479Assert.Equal(scheme, context.Request.Scheme);
Http2\Http2TestBase.cs (2)
192_receivedRequestFields.Scheme = context.Request.Scheme; 219_receivedRequestFields.Scheme = context.Request.Scheme;
Http2\Http2WebSocketTests.cs (3)
27Assert.Equal("http", context.Request.Scheme); 89Assert.Equal("http", context.Request.Scheme); 165Assert.Equal("http", context.Request.Scheme);
Http3\Http3StreamTests.cs (1)
303Assert.Equal(scheme, context.Request.Scheme);
HttpsConnectionMiddlewareTests.cs (1)
1118await using (var server = new TestServer(context => context.Response.WriteAsync(context.Request.Scheme), new TestServiceContext(LoggerFactory), ConfigureListenOptions))
InProcessWebSite (3)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (3)
280Assert.Equal("http", ctx.Request.Scheme); 282Assert.Equal("test", ctx.Request.Scheme); 1068ctx.Response.WriteAsync("Scheme:" + ctx.Request.Scheme + "; Original:" + ctx.Request.Headers["x-original-proto"]);
Microsoft.AspNetCore.Authentication (2)
AuthenticationHandler.cs (2)
106get => Request.Scheme + Uri.SchemeDelimiter + Request.Host + Request.PathBase + Request.Path + Request.QueryString; 197=> Request.Scheme + Uri.SchemeDelimiter + Request.Host + OriginalPathBase + targetPath;
Microsoft.AspNetCore.Components.Endpoints (3)
Rendering\EndpointHtmlRenderer.cs (2)
206request.Scheme, 215var result = UriHelper.BuildAbsolute(request.Scheme, request.Host, request.PathBase);
Rendering\EndpointHtmlRenderer.Prerendering.cs (1)
234return absoluteUri.Scheme != request.Scheme
Microsoft.AspNetCore.Hosting (12)
Internal\HostingApplicationDiagnostics.cs (3)
66context.MetricsTagsFeature.Scheme = httpContext.Request.Scheme; 384_metrics.RequestStart(httpContext.Request.Scheme, httpContext.Request.Method); 445[DynamicDependency(nameof(HttpRequest.Scheme), typeof(HttpRequest))]
Internal\HostingRequestFinishedLog.cs (3)
416 => new KeyValuePair<string, object?>(nameof(request.Scheme), request.Scheme), 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 (3)
294 => new KeyValuePair<string, object?>(nameof(_request.Scheme), _request.Scheme), 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)}";
Internal\HostingRequestUnhandledLog.cs (3)
241 => new KeyValuePair<string, object?>(nameof(_httpContext.Request.Scheme), _httpContext.Request.Scheme), 44_cachedToString = $"Request reached the end of the middleware pipeline without being handled by application code. Request path: {request.Method} {request.Scheme}://{request.Host}{request.PathBase}{request.Path}, Response status code: {response.StatusCode}";
Microsoft.AspNetCore.Hosting.Tests (2)
Internal\HostingRequestStartLogTests.cs (1)
19mockRequest.Setup(request => request.Scheme).Returns("http");
WebHostTests.cs (1)
963Assert.Throws<ObjectDisposedException>(() => capturedRequest.Scheme);
Microsoft.AspNetCore.Http (2)
src\Shared\Debugger\HttpContextDebugFormatter.cs (2)
92if (string.IsNullOrEmpty(request.Scheme) && 103var scheme = request.Scheme;
Microsoft.AspNetCore.Http.Extensions (2)
UriHelper.cs (2)
186return BuildAbsolute(request.Scheme, request.Host, request.PathBase, request.Path, request.QueryString); 207var scheme = request.Scheme ?? string.Empty;
Microsoft.AspNetCore.Http.Tests (3)
Internal\DefaultHttpRequestTests.cs (3)
122Assert.Equal(string.Empty, request.Scheme); 125Assert.Equal("https", request.Scheme); 127Assert.Equal("http", request.Scheme);
Microsoft.AspNetCore.HttpLogging (3)
HttpLoggingFields.cs (1)
65/// Flag for logging the HTTP Request <see cref="HttpRequest.Scheme"/>.
HttpLoggingMiddleware.cs (2)
124logContext.AddParameter(nameof(request.Scheme), request.Scheme);
Microsoft.AspNetCore.HttpOverrides (1)
ForwardedHeadersMiddleware.cs (1)
330requestHeaders[_options.OriginalProtoHeaderName] = request.Scheme;
Microsoft.AspNetCore.HttpOverrides.Tests (11)
ForwardedHeadersMiddlewareTest.cs (11)
639Assert.Equal(expected, context.Request.Scheme); 677Assert.Equal(scheme, context.Request.Scheme); 734Assert.Equal("http", context.Request.Scheme); 789Assert.Equal(expected, context.Request.Scheme); 831Assert.Equal(expected, context.Request.Scheme); 882Assert.Equal(expected, context.Request.Scheme); 926Assert.Equal("Protocol", context.Request.Scheme); 961Assert.Equal("http", context.Request.Scheme); 994Assert.Equal("Protocol", context.Request.Scheme); 1084Assert.Equal(expectedScheme, context.Request.Scheme); 1121Assert.Equal(expectedScheme, context.Request.Scheme);
Microsoft.AspNetCore.Identity.UI (14)
Areas\Identity\Pages\V4\Account\ExternalLogin.cshtml.cs (1)
206protocol: Request.Scheme)!;
Areas\Identity\Pages\V4\Account\ForgotPassword.cshtml.cs (1)
81protocol: Request.Scheme)!;
Areas\Identity\Pages\V4\Account\Manage\Email.cshtml.cs (2)
146protocol: Request.Scheme)!; 179protocol: Request.Scheme);
Areas\Identity\Pages\V4\Account\Register.cshtml.cs (1)
146protocol: Request.Scheme)!;
Areas\Identity\Pages\V4\Account\RegisterConfirmation.cshtml.cs (1)
82protocol: Request.Scheme);
Areas\Identity\Pages\V4\Account\ResendEmailConfirmation.cshtml.cs (1)
93protocol: Request.Scheme)!;
Areas\Identity\Pages\V5\Account\ExternalLogin.cshtml.cs (1)
206protocol: Request.Scheme)!;
Areas\Identity\Pages\V5\Account\ForgotPassword.cshtml.cs (1)
81protocol: Request.Scheme)!;
Areas\Identity\Pages\V5\Account\Manage\Email.cshtml.cs (2)
146protocol: Request.Scheme)!; 179protocol: Request.Scheme)!;
Areas\Identity\Pages\V5\Account\Register.cshtml.cs (1)
146protocol: Request.Scheme)!;
Areas\Identity\Pages\V5\Account\RegisterConfirmation.cshtml.cs (1)
82protocol: Request.Scheme);
Areas\Identity\Pages\V5\Account\ResendEmailConfirmation.cshtml.cs (1)
93protocol: Request.Scheme)!;
Microsoft.AspNetCore.Mvc.Core (7)
AcceptedAtActionResult.cs (1)
82request.Scheme,
CreatedAtActionResult.cs (1)
82request.Scheme,
Routing\ControllerLinkGeneratorExtensions.cs (1)
111/// The URI scheme, applied to the resulting URI. Optional. If not provided, the value of <see cref="HttpRequest.Scheme"/> will be used.
Routing\PageLinkGeneratorExtensions.cs (1)
112/// The URI scheme, applied to the resulting URI. Optional. If not provided, the value of <see cref="HttpRequest.Scheme"/> will be used.
Routing\UrlHelperBase.cs (1)
60Protocol = ActionContext.HttpContext.Request.Scheme,
UrlHelperExtensions.cs (2)
529protocol = httpContext.Request.Scheme; 578protocol = httpContext.Request.Scheme;
Microsoft.AspNetCore.Owin.Tests (1)
OwinEnvironmentTests.cs (1)
91Assert.Equal("http", context.Request.Scheme);
Microsoft.AspNetCore.ResponseCaching (1)
ResponseCachingKeyProvider.cs (1)
49.AppendUpperInvariant(request.Scheme)
Microsoft.AspNetCore.Rewrite (3)
PatternSegments\SchemeSegment.cs (1)
10return context.HttpContext.Request.Scheme;
RedirectRule.cs (1)
61string scheme = request.Scheme;
RedirectToWwwHelper.cs (1)
48request.Scheme,
Microsoft.AspNetCore.Rewrite.Tests (17)
ApacheModRewrite\ModRewriteMiddlewareTest.cs (4)
289app.Run(context => context.Response.WriteAsync(context.Request.Scheme + "://" + context.Request.Host.Host + context.Request.Path + context.Request.QueryString)); 315app.Run(context => context.Response.WriteAsync(context.Request.Scheme + "://" + context.Request.Host.Host + context.Request.Path + context.Request.QueryString)); 342app.Run(context => context.Response.WriteAsync(context.Request.Scheme + "://" + context.Request.Host.Host + context.Request.Path + context.Request.QueryString)); 370app.Run(context => context.Response.WriteAsync(context.Request.Scheme + "://" + context.Request.Host.Host + context.Request.Path + context.Request.QueryString));
IISUrlRewrite\MiddleWareTests.cs (3)
277context.Request.Scheme + 314context.Request.Scheme + 351context.Request.Scheme +
MiddlewareTests.cs (10)
29context.Request.Scheme + 59context.Request.Scheme + 91context.Request.Scheme + 123context.Request.Scheme + 861context.Request.Scheme + 899context.Request.Scheme + 935context.Request.Scheme + 972context.Request.Scheme + 1009context.Request.Scheme + 1042context.Request.Scheme +
Microsoft.AspNetCore.Routing (7)
DefaultLinkGenerator.cs (1)
142scheme ?? httpContext.Request.Scheme,
LinkGeneratorEndpointNameAddressExtensions.cs (2)
159/// The URI scheme, applied to the resulting URI. Optional. If not provided, the value of <see cref="HttpRequest.Scheme"/> will be used. 218/// The URI scheme, applied to the resulting URI. Optional. If not provided, the value of <see cref="HttpRequest.Scheme"/> will be used.
LinkGeneratorRouteValuesAddressExtensions.cs (2)
159/// The URI scheme, applied to the resulting URI. Optional. If not provided, the value of <see cref="HttpRequest.Scheme"/> will be used. 218/// The URI scheme, applied to the resulting URI. Optional. If not provided, the value of <see cref="HttpRequest.Scheme"/> will be used.
Matching\HostMatcherPolicy.cs (2)
340else if (string.Equals("https", httpContext.Request.Scheme, StringComparison.OrdinalIgnoreCase)) 344else if (string.Equals("http", httpContext.Request.Scheme, StringComparison.OrdinalIgnoreCase))
Microsoft.AspNetCore.Routing.Abstractions (1)
LinkGenerator.cs (1)
85/// The URI scheme, applied to the resulting URI. Optional. If not provided, the value of <see cref="HttpRequest.Scheme"/> will be used.
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (1)
Startup.cs (1)
126url = $"{context.Request.Scheme}://{context.Request.Host}/authorizedHub",
Microsoft.AspNetCore.StaticFiles (1)
Helpers.cs (1)
45var redirect = UriHelper.BuildAbsolute(request.Scheme, request.Host, request.PathBase, request.Path + "/", request.QueryString);
Microsoft.AspNetCore.TestHost.Tests (3)
ClientHandlerTests.cs (1)
52Assert.Equal("https", context.Request.Scheme);
HttpContextBuilderTests.cs (1)
33Assert.Equal("https", context.Request.Scheme);
WebSocketClientTests.cs (1)
29capturedScheme = ctx.Request.Scheme;
Microsoft.AspNetCore.Tests (2)
WebApplicationTests.cs (1)
1447Assert.Equal("https", context.Request.Scheme);
WebHostTests.cs (1)
74Assert.Equal("https", context.Request.Scheme);
Mvc.RoutingWebSite (4)
Controllers\ContactController.cs (2)
20return _generator.Generate(Url.RouteUrl("ActionAsMethod", null, Url.ActionContext.HttpContext.Request.Scheme)); 25return _generator.Generate(Url.RouteUrl("ActionAsMethod", null, Url.ActionContext.HttpContext.Request.Scheme));
Controllers\LoginController.cs (2)
20return _generator.Generate(Url.RouteUrl("ActionAsMethod", null, Url.ActionContext.HttpContext.Request.Scheme)); 25return _generator.Generate(Url.RouteUrl("ActionAsMethod", null, Url.ActionContext.HttpContext.Request.Scheme));
NativeIISSample (1)
Startup.cs (1)
40await context.Response.WriteAsync("Scheme: " + context.Request.Scheme + Environment.NewLine);