Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/aspnetcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHao Kung <HaoK@users.noreply.github.com>2022-06-07 19:31:36 +0300
committerGitHub <noreply@github.com>2022-06-07 19:31:36 +0300
commitdee3719a9386e7ff4b8396c440fa4abf13407ba6 (patch)
tree35e49ada48e67fc6255cbbdf2932b2209cfa73fc
parent0a405989e4130bef0d9e63a80f1d974b08d789d1 (diff)
parent7d0e20dc287815340e35654508ae384129f28c82 (diff)
Merge branch 'main' into haok/fixTestshaok/fixTests
-rw-r--r--.github/fabricbot.json1
-rw-r--r--.github/workflows/backport.yml8
-rw-r--r--.github/workflows/runtime-sync.yml6
-rw-r--r--AspNetCore.sln88
-rw-r--r--docs/UpdatingMajorVersionAndTFM.md1
-rw-r--r--eng/ProjectReferences.props1
-rw-r--r--eng/SharedFramework.Local.props1
-rw-r--r--eng/Version.Details.xml292
-rw-r--r--eng/Versions.props146
-rw-r--r--eng/Workarounds.props6
-rw-r--r--eng/helix/helix.proj7
-rw-r--r--eng/test-configuration.json3
-rw-r--r--global.json4
-rw-r--r--src/Components/Components/src/BindConverter.cs2
-rw-r--r--src/Components/Components/src/CascadingParameterState.cs5
-rw-r--r--src/Components/Components/src/DynamicComponent.cs1
-rw-r--r--src/Components/Components/src/LayoutAttribute.cs5
-rw-r--r--src/Components/Components/src/LayoutView.cs1
-rw-r--r--src/Components/Components/src/RouteView.cs2
-rw-r--r--src/Components/Components/src/Routing/RouteTableFactory.cs2
-rw-r--r--src/Components/Forms/src/EditContextDataAnnotationsExtensions.cs3
-rw-r--r--src/Components/Shared/src/ComponentParametersTypeCache.cs2
-rw-r--r--src/Components/Shared/src/RootComponentTypeCache.cs2
-rw-r--r--src/Components/Web.JS/package.json3
-rw-r--r--src/Components/Web.JS/yarn.lock53
-rw-r--r--src/Components/Web/src/JSComponents/JSComponentInterop.cs2
-rw-r--r--src/Components/WebAssembly/WebAssembly/src/Hosting/WebAssemblyHostBuilder.cs1
-rw-r--r--src/Components/WebAssembly/WebAssembly/src/HotReload/HotReloadAgent.cs3
-rw-r--r--src/Components/WebAssembly/WebAssembly/src/Prerendering/ClientComponentParameterDeserializer.cs3
-rw-r--r--src/DataProtection/DataProtection/src/Internal/HostingApplicationDiscriminator.cs22
-rw-r--r--src/DataProtection/DataProtection/test/DataProtectionUtilityExtensionsTests.cs48
-rw-r--r--src/DataProtection/DataProtection/test/HostingTests.cs23
-rw-r--r--src/Framework/AspNetCoreAnalyzers/test/Verifiers/CSharpRouteHandlerCodeFixVerifier.cs4
-rw-r--r--src/Framework/test/TestData.cs2
-rw-r--r--src/Hosting/Hosting/src/WebHostBuilder.cs1
-rw-r--r--src/Http/Headers/src/HeaderNames.cs3
-rw-r--r--src/Http/Headers/src/PublicAPI.Unshipped.txt1
-rw-r--r--src/Http/Http.Abstractions/src/Metadata/IRequestSizeLimitMetadata.cs15
-rw-r--r--src/Http/Http.Abstractions/src/PublicAPI.Unshipped.txt5
-rw-r--r--src/Http/Http.Abstractions/src/RouteHandlerContext.cs13
-rw-r--r--src/Http/Http.Extensions/src/EndpointMetadataContext.cs13
-rw-r--r--src/Http/Http.Extensions/src/EndpointParameterMetadataContext.cs13
-rw-r--r--src/Http/Http.Extensions/src/PublicAPI.Unshipped.txt8
-rw-r--r--src/Http/Http.Extensions/src/RequestDelegateFactory.cs16
-rw-r--r--src/Http/Http.Extensions/test/EndpointMetadataContextTests.cs26
-rw-r--r--src/Http/Http.Extensions/test/RequestDelegateFactoryTests.cs59
-rw-r--r--src/Http/Http.Results/test/AcceptedAtRouteOfTResultTests.cs2
-rw-r--r--src/Http/Http.Results/test/AcceptedAtRouteResultTests.cs2
-rw-r--r--src/Http/Http.Results/test/AcceptedOfTResultTests.cs2
-rw-r--r--src/Http/Http.Results/test/AcceptedResultTests.cs2
-rw-r--r--src/Http/Http.Results/test/BadRequestOfTResultTests.cs2
-rw-r--r--src/Http/Http.Results/test/BadRequestResultTests.cs2
-rw-r--r--src/Http/Http.Results/test/ConflictOfTResultTests.cs2
-rw-r--r--src/Http/Http.Results/test/ConflictResultTests.cs2
-rw-r--r--src/Http/Http.Results/test/CreatedAtRouteOfTResultTests.cs2
-rw-r--r--src/Http/Http.Results/test/CreatedAtRouteResultTests.cs2
-rw-r--r--src/Http/Http.Results/test/CreatedOfTResultTests.cs2
-rw-r--r--src/Http/Http.Results/test/CreatedResultTests.cs2
-rw-r--r--src/Http/Http.Results/test/EmptyServiceProvider.cs11
-rw-r--r--src/Http/Http.Results/test/NoContentResultTests.cs2
-rw-r--r--src/Http/Http.Results/test/NotFoundOfTResultTests.cs2
-rw-r--r--src/Http/Http.Results/test/NotFoundResultTests.cs2
-rw-r--r--src/Http/Http.Results/test/OkOfTResultTests.cs2
-rw-r--r--src/Http/Http.Results/test/OkResultTests.cs2
-rw-r--r--src/Http/Http.Results/test/ResultsOfTTests.Generated.cs10
-rw-r--r--src/Http/Http.Results/test/ResultsOfTTests.cs7
-rw-r--r--src/Http/Http.Results/test/UnprocessableEntityOfTResultTests.cs2
-rw-r--r--src/Http/Http.Results/test/UnprocessableEntityResultTests.cs2
-rw-r--r--src/Http/Http.Results/test/ValidationProblemResultTests.cs2
-rw-r--r--src/Http/Http.Results/tools/ResultsOfTGenerator/Program.cs4
-rw-r--r--src/Http/Routing/src/Builder/OpenApiRouteHandlerBuilderExtensions.cs124
-rw-r--r--src/Http/Routing/src/PublicAPI.Unshipped.txt6
-rw-r--r--src/Http/Routing/test/UnitTests/Builder/OpenApiRouteHandlerBuilderExtensionsTest.cs158
-rw-r--r--src/Http/Routing/test/UnitTests/Builder/RouteHandlerEndpointRouteBuilderExtensionsTest.cs49
-rw-r--r--src/Http/samples/MinimalSample/Program.cs2
-rw-r--r--src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ForgotPassword.cshtml4
-rw-r--r--src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Login.cshtml10
-rw-r--r--src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Register.cshtml18
-rw-r--r--src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ResendEmailConfirmation.cshtml4
-rw-r--r--src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ResetPassword.cshtml4
-rw-r--r--src/JSInterop/Microsoft.JSInterop/src/Infrastructure/DotNetDispatcher.cs5
-rw-r--r--src/JSInterop/Microsoft.JSInterop/src/Infrastructure/DotNetObjectReferenceJsonConverterFactory.cs2
-rw-r--r--src/JSInterop/Microsoft.JSInterop/src/JSRuntime.cs2
-rw-r--r--src/Middleware/HttpLogging/samples/Logging.W3C.Sample/Startup.cs3
-rw-r--r--src/Middleware/HttpLogging/src/FileLoggerProcessor.cs6
-rw-r--r--src/Middleware/HttpLogging/src/HttpLoggingOptions.cs5
-rw-r--r--src/Middleware/HttpLogging/src/PublicAPI.Unshipped.txt1
-rw-r--r--src/Middleware/HttpLogging/src/W3CLogger.cs27
-rw-r--r--src/Middleware/HttpLogging/src/W3CLoggerOptions.cs36
-rw-r--r--src/Middleware/HttpLogging/src/W3CLoggerProcessor.cs10
-rw-r--r--src/Middleware/HttpLogging/src/W3CLoggingMiddleware.cs23
-rw-r--r--src/Middleware/HttpLogging/test/FileLoggerProcessorTests.cs21
-rw-r--r--src/Middleware/HttpLogging/test/W3CLoggerTests.cs6
-rw-r--r--src/Middleware/HttpLogging/test/W3CLoggingMiddlewareTests.cs101
-rw-r--r--src/Middleware/Middleware.slnf6
-rw-r--r--src/Middleware/RequestDecompression/perf/Microbenchmarks/AssemblyInfo.cs4
-rw-r--r--src/Middleware/RequestDecompression/perf/Microbenchmarks/Microsoft.AspNetCore.RequestDecompression.Microbenchmarks.csproj15
-rw-r--r--src/Middleware/RequestDecompression/perf/Microbenchmarks/RequestDecompressionMiddlewareBenchmark.cs92
-rw-r--r--src/Middleware/RequestDecompression/sample/CustomDecompressionProvider.cs15
-rw-r--r--src/Middleware/RequestDecompression/sample/Properties/launchsettings.json27
-rw-r--r--src/Middleware/RequestDecompression/sample/RequestDecompressionSample.csproj13
-rw-r--r--src/Middleware/RequestDecompression/sample/Startup.cs48
-rw-r--r--src/Middleware/RequestDecompression/src/BrotliDecompressionProvider.cs18
-rw-r--r--src/Middleware/RequestDecompression/src/DefaultRequestDecompressionProvider.cs90
-rw-r--r--src/Middleware/RequestDecompression/src/DeflateDecompressionProvider.cs18
-rw-r--r--src/Middleware/RequestDecompression/src/GZipDecompressionProvider.cs18
-rw-r--r--src/Middleware/RequestDecompression/src/IDecompressionProvider.cs17
-rw-r--r--src/Middleware/RequestDecompression/src/IRequestDecompressionProvider.cs19
-rw-r--r--src/Middleware/RequestDecompression/src/Microsoft.AspNetCore.RequestDecompression.csproj24
-rw-r--r--src/Middleware/RequestDecompression/src/PublicAPI.Shipped.txt1
-rw-r--r--src/Middleware/RequestDecompression/src/PublicAPI.Unshipped.txt13
-rw-r--r--src/Middleware/RequestDecompression/src/RequestDecompressionBuilderExtensions.cs26
-rw-r--r--src/Middleware/RequestDecompression/src/RequestDecompressionMiddleware.cs141
-rw-r--r--src/Middleware/RequestDecompression/src/RequestDecompressionOptions.cs20
-rw-r--r--src/Middleware/RequestDecompression/src/RequestDecompressionServiceExtensions.cs52
-rw-r--r--src/Middleware/RequestDecompression/src/SizeLimitedStream.cs94
-rw-r--r--src/Middleware/RequestDecompression/test/DefaultRequestDecompressionProviderTests.cs176
-rw-r--r--src/Middleware/RequestDecompression/test/Microsoft.AspNetCore.RequestDecompression.Tests.csproj14
-rw-r--r--src/Middleware/RequestDecompression/test/RequestDecompressionBuilderExtensionsTests.cs22
-rw-r--r--src/Middleware/RequestDecompression/test/RequestDecompressionMiddlewareTests.cs945
-rw-r--r--src/Middleware/RequestDecompression/test/RequestDecompressionOptionsTests.cs30
-rw-r--r--src/Middleware/RequestDecompression/test/RequestDecompressionServiceExtensionsTests.cs37
-rw-r--r--src/Middleware/RequestDecompression/test/SizeLimitedStreamTests.cs107
-rw-r--r--src/Middleware/Spa/SpaProxy/src/SpaHostingStartup.cs10
-rw-r--r--src/Mvc/Mvc.Core/src/DisableRequestSizeLimitAttribute.cs12
-rw-r--r--src/Mvc/Mvc.Core/src/RequestSizeLimitAttribute.cs8
-rw-r--r--src/Mvc/test/Mvc.FunctionalTests/SimpleWithWebApplicationBuilderTests.cs20
-rw-r--r--src/Mvc/test/WebSites/SimpleWebSiteWithWebApplicationBuilder/Program.cs4
-rw-r--r--src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets2
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/localize/templatestrings.en.json6
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/template.json8
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Pages/_Host.cshtml1
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Properties/launchSettings.json19
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/wwwroot/favicon.icobin5430 -> 0 bytes
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/wwwroot/favicon.pngbin0 -> 1148 bytes
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/favicon.icobin5430 -> 0 bytes
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/favicon.pngbin0 -> 1148 bytes
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/index.html1
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/Properties/launchSettings.json15
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-FSharp/Properties/launchSettings.json15
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Properties/launchSettings.json13
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/localize/templatestrings.en.json6
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/template.json8
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Properties/launchSettings.json19
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/.template.config/localize/templatestrings.en.json6
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/.template.config/template.json8
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Properties/launchSettings.json19
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/Properties/launchSettings.json15
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/localize/templatestrings.en.json6
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/template.json8
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Properties/launchSettings.json22
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/.template.config/localize/templatestrings.en.json6
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/.template.config/template.json6
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/Properties/launchSettings.json22
-rw-r--r--src/ProjectTemplates/scripts/Test-Template.ps12
-rw-r--r--src/ProjectTemplates/test/template-baselines.json12
-rw-r--r--src/Security/Authentication/Cookies/src/CookieAuthenticationHandler.cs34
-rw-r--r--src/Security/Authentication/Cookies/src/ITicketStore.cs39
-rw-r--r--src/Security/Authentication/Cookies/src/PublicAPI.Unshipped.txt4
-rw-r--r--src/Security/Authentication/test/CookieTests.cs34
-rw-r--r--src/Servers/Kestrel/Core/src/CoreStrings.resx11
-rw-r--r--src/Servers/Kestrel/Core/src/Internal/Http/HttpHeaders.Generated.cs1745
-rw-r--r--src/Servers/Kestrel/Core/src/Internal/Http3/Http3Connection.cs10
-rw-r--r--src/Servers/Kestrel/Core/src/Internal/Http3/Http3ControlStream.cs2
-rw-r--r--src/Servers/Kestrel/Core/src/Internal/Http3/Http3PeerSettings.cs14
-rw-r--r--src/Servers/Kestrel/Core/src/Internal/Http3/Http3SettingType.cs15
-rw-r--r--src/Servers/Kestrel/Core/src/Internal/Http3/Http3Stream.cs30
-rw-r--r--src/Servers/Kestrel/Core/src/KestrelServerOptions.cs18
-rw-r--r--src/Servers/Kestrel/samples/Http3SampleApp/Http3SampleApp.csproj5
-rw-r--r--src/Servers/Kestrel/samples/Http3SampleApp/Program.cs75
-rw-r--r--src/Servers/Kestrel/shared/KnownHeaders.cs5
-rw-r--r--src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/WebTransportTests.cs138
-rw-r--r--src/Shared/ParameterBindingMethodCache.cs5
-rw-r--r--src/Shared/runtime/Http3/Http3SettingType.cs15
-rw-r--r--src/Shared/runtime/NetEventSource.Common.cs4
-rw-r--r--src/SignalR/clients/ts/FunctionalTests/package.json1
-rw-r--r--src/SignalR/clients/ts/FunctionalTests/ts/ConnectionTests.ts3
-rw-r--r--src/SignalR/clients/ts/FunctionalTests/ts/HubConnectionTests.ts23
-rw-r--r--src/SignalR/clients/ts/FunctionalTests/yarn.lock48
-rw-r--r--src/SignalR/clients/ts/signalr/package.json9
-rw-r--r--src/SignalR/clients/ts/signalr/src/FetchHttpClient.ts18
-rw-r--r--src/SignalR/clients/ts/signalr/src/XhrHttpClient.ts16
-rw-r--r--src/SignalR/clients/ts/signalr/tests/FetchHttpClient.test.ts48
-rw-r--r--src/SignalR/clients/ts/signalr/yarn.lock59
-rw-r--r--src/SignalR/server/Core/src/IHubClients`T.cs2
-rw-r--r--src/SignalR/server/Core/src/Internal/HubClients.cs2
-rw-r--r--src/SignalR/server/Core/src/Internal/HubClients`T.cs5
-rw-r--r--src/SignalR/server/Core/src/Internal/Proxies.cs21
-rw-r--r--src/SignalR/server/Core/src/Internal/TypedHubClients.cs7
-rw-r--r--src/SignalR/server/SignalR/test/ClientProxyTests.cs2
-rw-r--r--src/SignalR/server/SignalR/test/HubConnectionHandlerTestUtils/Hubs.cs12
-rw-r--r--src/SignalR/server/SignalR/test/HubConnectionHandlerTests.ClientResult.cs69
-rw-r--r--src/SignalR/server/StackExchangeRedis/src/Internal/RedisLog.cs3
-rw-r--r--src/SignalR/server/StackExchangeRedis/src/RedisHubLifetimeManager.cs28
-rw-r--r--src/SignalR/server/StackExchangeRedis/test/RedisHubLifetimeManagerTests.cs42
m---------src/submodules/googletest0
196 files changed, 5083 insertions, 1564 deletions
diff --git a/.github/fabricbot.json b/.github/fabricbot.json
index 4b5e51af21..9b1d7d3642 100644
--- a/.github/fabricbot.json
+++ b/.github/fabricbot.json
@@ -1466,6 +1466,7 @@
"global.json",
".azure",
".config",
+ ".github",
"eng",
"src/Framework/",
"src/Installers/"
diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml
index c4eef86470..3c87042454 100644
--- a/.github/workflows/backport.yml
+++ b/.github/workflows/backport.yml
@@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Extract backport target branch
- uses: actions/github-script@v3
+ uses: actions/github-script@v6
id: target-branch-extractor
with:
result-encoding: string
@@ -28,18 +28,18 @@ jobs:
return target_branch[1];
- name: Post backport started comment to pull request
- uses: actions/github-script@v3
+ uses: actions/github-script@v6
with:
script: |
const backport_start_body = `Started backporting to ${{ steps.target-branch-extractor.outputs.result }}: https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}`;
- await github.issues.createComment({
+ await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: backport_start_body
});
- name: Checkout repo
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Run backport
diff --git a/.github/workflows/runtime-sync.yml b/.github/workflows/runtime-sync.yml
index 15896560d2..e80c233326 100644
--- a/.github/workflows/runtime-sync.yml
+++ b/.github/workflows/runtime-sync.yml
@@ -21,14 +21,14 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout aspnetcore
- uses: actions/checkout@v2.0.0
+ uses: actions/checkout@v3
with:
# Test this script using changes in a fork
repository: 'dotnet/aspnetcore'
path: aspnetcore
ref: main
- name: Checkout runtime
- uses: actions/checkout@v2.0.0
+ uses: actions/checkout@v3
with:
# Test this script using changes in a fork
repository: 'dotnet/runtime'
@@ -47,7 +47,7 @@ jobs:
mkdir ..\artifacts
git status > ..\artifacts\status.txt
git diff > ..\artifacts\diff.txt
- - uses: actions/upload-artifact@v1
+ - uses: actions/upload-artifact@v3
with:
name: results
path: artifacts
diff --git a/AspNetCore.sln b/AspNetCore.sln
index 02b6e7c51c..c5afa4b473 100644
--- a/AspNetCore.sln
+++ b/AspNetCore.sln
@@ -1654,6 +1654,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Compon
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Components.SdkAnalyzers.Tests", "src\Tools\SDK-Analyzers\Components\test\Microsoft.AspNetCore.Components.SdkAnalyzers.Tests.csproj", "{DC349A25-0DBF-4468-99E1-B95C22D3A7EF}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RequestDecompression", "RequestDecompression", "{5465F96F-33D5-454E-9C40-494E58AEEE5D}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.RequestDecompression.Tests", "src\Middleware\RequestDecompression\test\Microsoft.AspNetCore.RequestDecompression.Tests.csproj", "{97996D39-7722-4AFC-A41A-AD61CA7A413D}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RequestDecompressionSample", "src\Middleware\RequestDecompression\sample\RequestDecompressionSample.csproj", "{37144E52-611B-40E8-807C-2821F5A814CB}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.RequestDecompression", "src\Middleware\RequestDecompression\src\Microsoft.AspNetCore.RequestDecompression.csproj", "{559FE354-7E08-4310-B4F3-AE30F34DEED5}"
+EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LinkabilityChecker", "LinkabilityChecker", "{94F95276-7CDF-44A8-B159-D09702EF6794}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LinkabilityChecker", "src\Tools\LinkabilityChecker\LinkabilityChecker.csproj", "{EA7D844B-C180-41C7-9D55-273AD88BF71F}"
@@ -1710,6 +1718,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Html.A
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RateLimiting", "RateLimiting", "{1D865E78-7A66-4CA9-92EE-2B350E45281F}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.RequestDecompression.Microbenchmarks", "src\Middleware\RequestDecompression\perf\Microbenchmarks\Microsoft.AspNetCore.RequestDecompression.Microbenchmarks.csproj", "{3309FA1E-4E95-49E9-BE2A-827D01FD63C0}"
+EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-user-jwts", "src\Tools\dotnet-user-jwts\src\dotnet-user-jwts.csproj", "{B34CB502-0286-4939-B25F-45998528A802}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnet-user-jwts", "dotnet-user-jwts", "{AB4B9E75-719C-4589-B852-20FBFD727730}"
@@ -1718,6 +1728,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MinimalJwtBearerSample", "s
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-user-jwts.Tests", "src\Tools\dotnet-user-jwts\test\dotnet-user-jwts.Tests.csproj", "{89896261-C5DD-4901-BCA7-7A5F718BC008}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestInfrastructure", "TestInfrastructure", "{F0FBA346-D8BC-4FAE-A4B2-85B33FA23055}"
+ ProjectSection(SolutionItems) = preProject
+ src\ProjectTemplates\TestInfrastructure\Directory.Build.props.in = src\ProjectTemplates\TestInfrastructure\Directory.Build.props.in
+ src\ProjectTemplates\TestInfrastructure\Directory.Build.targets.in = src\ProjectTemplates\TestInfrastructure\Directory.Build.targets.in
+ src\ProjectTemplates\TestInfrastructure\PrepareForTest.targets = src\ProjectTemplates\TestInfrastructure\PrepareForTest.targets
+ src\ProjectTemplates\TestInfrastructure\runtimeconfig.norollforward.json = src\ProjectTemplates\TestInfrastructure\runtimeconfig.norollforward.json
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -9967,6 +9985,54 @@ Global
{DC349A25-0DBF-4468-99E1-B95C22D3A7EF}.Release|x64.Build.0 = Release|Any CPU
{DC349A25-0DBF-4468-99E1-B95C22D3A7EF}.Release|x86.ActiveCfg = Release|Any CPU
{DC349A25-0DBF-4468-99E1-B95C22D3A7EF}.Release|x86.Build.0 = Release|Any CPU
+ {97996D39-7722-4AFC-A41A-AD61CA7A413D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {97996D39-7722-4AFC-A41A-AD61CA7A413D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {97996D39-7722-4AFC-A41A-AD61CA7A413D}.Debug|arm64.ActiveCfg = Debug|Any CPU
+ {97996D39-7722-4AFC-A41A-AD61CA7A413D}.Debug|arm64.Build.0 = Debug|Any CPU
+ {97996D39-7722-4AFC-A41A-AD61CA7A413D}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {97996D39-7722-4AFC-A41A-AD61CA7A413D}.Debug|x64.Build.0 = Debug|Any CPU
+ {97996D39-7722-4AFC-A41A-AD61CA7A413D}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {97996D39-7722-4AFC-A41A-AD61CA7A413D}.Debug|x86.Build.0 = Debug|Any CPU
+ {97996D39-7722-4AFC-A41A-AD61CA7A413D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {97996D39-7722-4AFC-A41A-AD61CA7A413D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {97996D39-7722-4AFC-A41A-AD61CA7A413D}.Release|arm64.ActiveCfg = Release|Any CPU
+ {97996D39-7722-4AFC-A41A-AD61CA7A413D}.Release|arm64.Build.0 = Release|Any CPU
+ {97996D39-7722-4AFC-A41A-AD61CA7A413D}.Release|x64.ActiveCfg = Release|Any CPU
+ {97996D39-7722-4AFC-A41A-AD61CA7A413D}.Release|x64.Build.0 = Release|Any CPU
+ {97996D39-7722-4AFC-A41A-AD61CA7A413D}.Release|x86.ActiveCfg = Release|Any CPU
+ {97996D39-7722-4AFC-A41A-AD61CA7A413D}.Release|x86.Build.0 = Release|Any CPU
+ {37144E52-611B-40E8-807C-2821F5A814CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {37144E52-611B-40E8-807C-2821F5A814CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {37144E52-611B-40E8-807C-2821F5A814CB}.Debug|arm64.ActiveCfg = Debug|Any CPU
+ {37144E52-611B-40E8-807C-2821F5A814CB}.Debug|arm64.Build.0 = Debug|Any CPU
+ {37144E52-611B-40E8-807C-2821F5A814CB}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {37144E52-611B-40E8-807C-2821F5A814CB}.Debug|x64.Build.0 = Debug|Any CPU
+ {37144E52-611B-40E8-807C-2821F5A814CB}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {37144E52-611B-40E8-807C-2821F5A814CB}.Debug|x86.Build.0 = Debug|Any CPU
+ {37144E52-611B-40E8-807C-2821F5A814CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {37144E52-611B-40E8-807C-2821F5A814CB}.Release|Any CPU.Build.0 = Release|Any CPU
+ {37144E52-611B-40E8-807C-2821F5A814CB}.Release|arm64.ActiveCfg = Release|Any CPU
+ {37144E52-611B-40E8-807C-2821F5A814CB}.Release|arm64.Build.0 = Release|Any CPU
+ {37144E52-611B-40E8-807C-2821F5A814CB}.Release|x64.ActiveCfg = Release|Any CPU
+ {37144E52-611B-40E8-807C-2821F5A814CB}.Release|x64.Build.0 = Release|Any CPU
+ {37144E52-611B-40E8-807C-2821F5A814CB}.Release|x86.ActiveCfg = Release|Any CPU
+ {37144E52-611B-40E8-807C-2821F5A814CB}.Release|x86.Build.0 = Release|Any CPU
+ {559FE354-7E08-4310-B4F3-AE30F34DEED5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {559FE354-7E08-4310-B4F3-AE30F34DEED5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {559FE354-7E08-4310-B4F3-AE30F34DEED5}.Debug|arm64.ActiveCfg = Debug|Any CPU
+ {559FE354-7E08-4310-B4F3-AE30F34DEED5}.Debug|arm64.Build.0 = Debug|Any CPU
+ {559FE354-7E08-4310-B4F3-AE30F34DEED5}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {559FE354-7E08-4310-B4F3-AE30F34DEED5}.Debug|x64.Build.0 = Debug|Any CPU
+ {559FE354-7E08-4310-B4F3-AE30F34DEED5}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {559FE354-7E08-4310-B4F3-AE30F34DEED5}.Debug|x86.Build.0 = Debug|Any CPU
+ {559FE354-7E08-4310-B4F3-AE30F34DEED5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {559FE354-7E08-4310-B4F3-AE30F34DEED5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {559FE354-7E08-4310-B4F3-AE30F34DEED5}.Release|arm64.ActiveCfg = Release|Any CPU
+ {559FE354-7E08-4310-B4F3-AE30F34DEED5}.Release|arm64.Build.0 = Release|Any CPU
+ {559FE354-7E08-4310-B4F3-AE30F34DEED5}.Release|x64.ActiveCfg = Release|Any CPU
+ {559FE354-7E08-4310-B4F3-AE30F34DEED5}.Release|x64.Build.0 = Release|Any CPU
+ {559FE354-7E08-4310-B4F3-AE30F34DEED5}.Release|x86.ActiveCfg = Release|Any CPU
+ {559FE354-7E08-4310-B4F3-AE30F34DEED5}.Release|x86.Build.0 = Release|Any CPU
{EA7D844B-C180-41C7-9D55-273AD88BF71F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EA7D844B-C180-41C7-9D55-273AD88BF71F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EA7D844B-C180-41C7-9D55-273AD88BF71F}.Debug|arm64.ActiveCfg = Debug|Any CPU
@@ -10255,6 +10321,22 @@ Global
{487EF7BE-5009-4C70-B79E-45519BDD9603}.Release|x64.Build.0 = Release|Any CPU
{487EF7BE-5009-4C70-B79E-45519BDD9603}.Release|x86.ActiveCfg = Release|Any CPU
{487EF7BE-5009-4C70-B79E-45519BDD9603}.Release|x86.Build.0 = Release|Any CPU
+ {3309FA1E-4E95-49E9-BE2A-827D01FD63C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3309FA1E-4E95-49E9-BE2A-827D01FD63C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3309FA1E-4E95-49E9-BE2A-827D01FD63C0}.Debug|arm64.ActiveCfg = Debug|Any CPU
+ {3309FA1E-4E95-49E9-BE2A-827D01FD63C0}.Debug|arm64.Build.0 = Debug|Any CPU
+ {3309FA1E-4E95-49E9-BE2A-827D01FD63C0}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {3309FA1E-4E95-49E9-BE2A-827D01FD63C0}.Debug|x64.Build.0 = Debug|Any CPU
+ {3309FA1E-4E95-49E9-BE2A-827D01FD63C0}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {3309FA1E-4E95-49E9-BE2A-827D01FD63C0}.Debug|x86.Build.0 = Debug|Any CPU
+ {3309FA1E-4E95-49E9-BE2A-827D01FD63C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3309FA1E-4E95-49E9-BE2A-827D01FD63C0}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3309FA1E-4E95-49E9-BE2A-827D01FD63C0}.Release|arm64.ActiveCfg = Release|Any CPU
+ {3309FA1E-4E95-49E9-BE2A-827D01FD63C0}.Release|arm64.Build.0 = Release|Any CPU
+ {3309FA1E-4E95-49E9-BE2A-827D01FD63C0}.Release|x64.ActiveCfg = Release|Any CPU
+ {3309FA1E-4E95-49E9-BE2A-827D01FD63C0}.Release|x64.Build.0 = Release|Any CPU
+ {3309FA1E-4E95-49E9-BE2A-827D01FD63C0}.Release|x86.ActiveCfg = Release|Any CPU
+ {3309FA1E-4E95-49E9-BE2A-827D01FD63C0}.Release|x86.Build.0 = Release|Any CPU
{B34CB502-0286-4939-B25F-45998528A802}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B34CB502-0286-4939-B25F-45998528A802}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B34CB502-0286-4939-B25F-45998528A802}.Debug|arm64.ActiveCfg = Debug|Any CPU
@@ -11122,6 +11204,10 @@ Global
{CC45FA2D-128B-485D-BA6D-DFD9735CB3C3} = {6C06163A-80E9-49C1-817C-B391852BA563}
{825BCF97-67A9-4834-B3A8-C3DC97A90E41} = {CC45FA2D-128B-485D-BA6D-DFD9735CB3C3}
{DC349A25-0DBF-4468-99E1-B95C22D3A7EF} = {CC45FA2D-128B-485D-BA6D-DFD9735CB3C3}
+ {5465F96F-33D5-454E-9C40-494E58AEEE5D} = {E5963C9F-20A6-4385-B364-814D2581FADF}
+ {97996D39-7722-4AFC-A41A-AD61CA7A413D} = {5465F96F-33D5-454E-9C40-494E58AEEE5D}
+ {37144E52-611B-40E8-807C-2821F5A814CB} = {5465F96F-33D5-454E-9C40-494E58AEEE5D}
+ {559FE354-7E08-4310-B4F3-AE30F34DEED5} = {5465F96F-33D5-454E-9C40-494E58AEEE5D}
{94F95276-7CDF-44A8-B159-D09702EF6794} = {0B200A66-B809-4ED3-A790-CB1C2E80975E}
{EA7D844B-C180-41C7-9D55-273AD88BF71F} = {94F95276-7CDF-44A8-B159-D09702EF6794}
{7A331A1C-E2C4-4E37-B0A0-B5AA10661229} = {8DAC59BE-CB96-4F04-909C-56C22E7665EB}
@@ -11150,10 +11236,12 @@ Global
{51D07AA9-6297-4F66-A7BD-71CE7E3F4A3F} = {0F84F170-57D0-496B-8E2C-7984178EF69F}
{487EF7BE-5009-4C70-B79E-45519BDD9603} = {412D4C15-F48F-4DB1-940A-131D1AA87088}
{1D865E78-7A66-4CA9-92EE-2B350E45281F} = {E5963C9F-20A6-4385-B364-814D2581FADF}
+ {3309FA1E-4E95-49E9-BE2A-827D01FD63C0} = {5465F96F-33D5-454E-9C40-494E58AEEE5D}
{B34CB502-0286-4939-B25F-45998528A802} = {AB4B9E75-719C-4589-B852-20FBFD727730}
{AB4B9E75-719C-4589-B852-20FBFD727730} = {0B200A66-B809-4ED3-A790-CB1C2E80975E}
{7F079E92-32D5-4257-B95B-CFFB0D49C160} = {7FD32066-C831-4E29-978C-9A2215E85C67}
{89896261-C5DD-4901-BCA7-7A5F718BC008} = {AB4B9E75-719C-4589-B852-20FBFD727730}
+ {F0FBA346-D8BC-4FAE-A4B2-85B33FA23055} = {08D53E58-4AAE-40C4-8497-63EC8664F304}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3E8720B3-DBDD-498C-B383-2CC32A054E8F}
diff --git a/docs/UpdatingMajorVersionAndTFM.md b/docs/UpdatingMajorVersionAndTFM.md
index ec0f304d65..b51d78f257 100644
--- a/docs/UpdatingMajorVersionAndTFM.md
+++ b/docs/UpdatingMajorVersionAndTFM.md
@@ -18,6 +18,7 @@ Typically, we will update the Major Version before updating the TFM. This is bec
* In [src/Framework/test/TestData.cs](/src/Framework/test/TestData.cs), update `ListedTargetingPackAssemblies` by incrementing the AssemblyVersion of all aspnetcore assemblies by 1 major version. Once dotnet/runtime updates their AssemblyVersions, we also need to update those in this file. They typically make that change at the same time as their TFM update, but we change our AssemblyVersions as soon as we update branding.
* Add entries to [NuGet.config](/NuGet.config) for the new Major Version's feed. This just means copying the current feeds (e.g. `dotnet7` and `dotnet7-transport`) and adding entries for the new feeds (`dotnet8` and `dotnet8-transport`). Make an effort to remove old feeds here at the same time.
* In [src/ProjectTemplates/Shared/TemplatePackageInstaller.cs](/src/ProjectTemplates/Shared/TemplatePackageInstaller.cs), add entries to `_templatePackages ` for `Microsoft.DotNet.Web.ProjectTemplates` and `Microsoft.DotNet.Web.Spa.ProjectTemplates` matching the new version.
+* In [src/Framework/AspNetCoreAnalyzers/test/Verifiers/CSharpRouteHandlerCodeFixVerifier.cs], update the references to `ReferenceAssemblies.Net.Netx0` with the latest version.
### Validation
diff --git a/eng/ProjectReferences.props b/eng/ProjectReferences.props
index d59faa1b0d..c0842d685c 100644
--- a/eng/ProjectReferences.props
+++ b/eng/ProjectReferences.props
@@ -90,6 +90,7 @@
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Localization" ProjectPath="$(RepoRoot)src\Middleware\Localization\src\Microsoft.AspNetCore.Localization.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.MiddlewareAnalysis" ProjectPath="$(RepoRoot)src\Middleware\MiddlewareAnalysis\src\Microsoft.AspNetCore.MiddlewareAnalysis.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.RateLimiting" ProjectPath="$(RepoRoot)src\Middleware\RateLimiting\src\Microsoft.AspNetCore.RateLimiting.csproj" />
+ <ProjectReferenceProvider Include="Microsoft.AspNetCore.RequestDecompression" ProjectPath="$(RepoRoot)src\Middleware\RequestDecompression\src\Microsoft.AspNetCore.RequestDecompression.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.ResponseCaching.Abstractions" ProjectPath="$(RepoRoot)src\Middleware\ResponseCaching.Abstractions\src\Microsoft.AspNetCore.ResponseCaching.Abstractions.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.ResponseCaching" ProjectPath="$(RepoRoot)src\Middleware\ResponseCaching\src\Microsoft.AspNetCore.ResponseCaching.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.ResponseCompression" ProjectPath="$(RepoRoot)src\Middleware\ResponseCompression\src\Microsoft.AspNetCore.ResponseCompression.csproj" />
diff --git a/eng/SharedFramework.Local.props b/eng/SharedFramework.Local.props
index f32bf007b8..b727b8df0f 100644
--- a/eng/SharedFramework.Local.props
+++ b/eng/SharedFramework.Local.props
@@ -77,6 +77,7 @@
<AspNetCoreAppReference Include="Microsoft.AspNetCore.HttpsPolicy" />
<AspNetCoreAppReference Include="Microsoft.AspNetCore.Localization.Routing" />
<AspNetCoreAppReference Include="Microsoft.AspNetCore.Localization" />
+ <AspNetCoreAppReference Include="Microsoft.AspNetCore.RequestDecompression" />
<AspNetCoreAppReference Include="Microsoft.AspNetCore.ResponseCaching.Abstractions" />
<AspNetCoreAppReference Include="Microsoft.AspNetCore.ResponseCaching" />
<AspNetCoreAppReference Include="Microsoft.AspNetCore.ResponseCompression" />
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index cd01489a09..ec95edcfa3 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -9,305 +9,305 @@
-->
<Dependencies>
<ProductDependencies>
- <Dependency Name="dotnet-ef" Version="7.0.0-preview.6.22301.1">
+ <Dependency Name="dotnet-ef" Version="7.0.0-preview.6.22302.1">
<Uri>https://github.com/dotnet/efcore</Uri>
- <Sha>c4783e2d2ec3fbd471f8c841a71b5e4a27e09a2d</Sha>
+ <Sha>f43f454304620596930d5b82319a03baf8ea7ae9</Sha>
</Dependency>
- <Dependency Name="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.0-preview.6.22301.1">
+ <Dependency Name="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.0-preview.6.22302.1">
<Uri>https://github.com/dotnet/efcore</Uri>
- <Sha>c4783e2d2ec3fbd471f8c841a71b5e4a27e09a2d</Sha>
+ <Sha>f43f454304620596930d5b82319a03baf8ea7ae9</Sha>
</Dependency>
- <Dependency Name="Microsoft.EntityFrameworkCore.Relational" Version="7.0.0-preview.6.22301.1">
+ <Dependency Name="Microsoft.EntityFrameworkCore.Relational" Version="7.0.0-preview.6.22302.1">
<Uri>https://github.com/dotnet/efcore</Uri>
- <Sha>c4783e2d2ec3fbd471f8c841a71b5e4a27e09a2d</Sha>
+ <Sha>f43f454304620596930d5b82319a03baf8ea7ae9</Sha>
</Dependency>
- <Dependency Name="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.0-preview.6.22301.1">
+ <Dependency Name="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.0-preview.6.22302.1">
<Uri>https://github.com/dotnet/efcore</Uri>
- <Sha>c4783e2d2ec3fbd471f8c841a71b5e4a27e09a2d</Sha>
+ <Sha>f43f454304620596930d5b82319a03baf8ea7ae9</Sha>
</Dependency>
- <Dependency Name="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0-preview.6.22301.1">
+ <Dependency Name="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0-preview.6.22302.1">
<Uri>https://github.com/dotnet/efcore</Uri>
- <Sha>c4783e2d2ec3fbd471f8c841a71b5e4a27e09a2d</Sha>
+ <Sha>f43f454304620596930d5b82319a03baf8ea7ae9</Sha>
</Dependency>
- <Dependency Name="Microsoft.EntityFrameworkCore.Tools" Version="7.0.0-preview.6.22301.1">
+ <Dependency Name="Microsoft.EntityFrameworkCore.Tools" Version="7.0.0-preview.6.22302.1">
<Uri>https://github.com/dotnet/efcore</Uri>
- <Sha>c4783e2d2ec3fbd471f8c841a71b5e4a27e09a2d</Sha>
+ <Sha>f43f454304620596930d5b82319a03baf8ea7ae9</Sha>
</Dependency>
- <Dependency Name="Microsoft.EntityFrameworkCore" Version="7.0.0-preview.6.22301.1">
+ <Dependency Name="Microsoft.EntityFrameworkCore" Version="7.0.0-preview.6.22302.1">
<Uri>https://github.com/dotnet/efcore</Uri>
- <Sha>c4783e2d2ec3fbd471f8c841a71b5e4a27e09a2d</Sha>
+ <Sha>f43f454304620596930d5b82319a03baf8ea7ae9</Sha>
</Dependency>
- <Dependency Name="Microsoft.EntityFrameworkCore.Design" Version="7.0.0-preview.6.22301.1">
+ <Dependency Name="Microsoft.EntityFrameworkCore.Design" Version="7.0.0-preview.6.22302.1">
<Uri>https://github.com/dotnet/efcore</Uri>
- <Sha>c4783e2d2ec3fbd471f8c841a71b5e4a27e09a2d</Sha>
+ <Sha>f43f454304620596930d5b82319a03baf8ea7ae9</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Caching.Abstractions" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Caching.Abstractions" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Caching.Memory" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Caching.Memory" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Configuration.Binder" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Configuration.Binder" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Configuration.CommandLine" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Configuration.CommandLine" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Configuration.FileExtensions" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Configuration.FileExtensions" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Configuration.Ini" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Configuration.Ini" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Configuration.Json" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Configuration.Json" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Configuration.Xml" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Configuration.Xml" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Configuration" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Configuration" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.DependencyInjection" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.DependencyInjection" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.FileProviders.Abstractions" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.FileProviders.Abstractions" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.FileProviders.Composite" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.FileProviders.Composite" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.FileProviders.Physical" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.FileProviders.Physical" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.FileSystemGlobbing" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.FileSystemGlobbing" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.HostFactoryResolver.Sources" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.HostFactoryResolver.Sources" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Hosting" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Hosting" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Http" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Http" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Logging.Configuration" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Logging.Configuration" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Logging.Console" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Logging.Console" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Logging.Debug" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Logging.Debug" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Logging.EventSource" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Logging.EventSource" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Logging.EventLog" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Logging.EventLog" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Logging.TraceSource" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Logging.TraceSource" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Logging" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Logging" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Options.DataAnnotations" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Options.DataAnnotations" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Options" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Options" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.Primitives" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.Primitives" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Internal.Runtime.AspNetCore.Transport" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Internal.Runtime.AspNetCore.Transport" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="System.Configuration.ConfigurationManager" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="System.Configuration.ConfigurationManager" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="System.Diagnostics.DiagnosticSource" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="System.Diagnostics.DiagnosticSource" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="System.Diagnostics.EventLog" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="System.Diagnostics.EventLog" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="System.DirectoryServices.Protocols" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="System.DirectoryServices.Protocols" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="System.IO.Pipelines" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="System.IO.Pipelines" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="System.Net.Http.Json" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="System.Net.Http.Json" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="System.Net.Http.WinHttpHandler" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="System.Net.Http.WinHttpHandler" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="System.Reflection.Metadata" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="System.Reflection.Metadata" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="System.Resources.Extensions" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="System.Resources.Extensions" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="System.Security.Cryptography.Pkcs" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="System.Security.Cryptography.Pkcs" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="System.Security.Cryptography.Xml" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="System.Security.Cryptography.Xml" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="System.Security.Permissions" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="System.Security.Permissions" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="System.ServiceProcess.ServiceController" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="System.ServiceProcess.ServiceController" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="System.Text.Encodings.Web" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="System.Text.Encodings.Web" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="System.Text.Json" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="System.Text.Json" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="System.Threading.AccessControl" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="System.Threading.AccessControl" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="System.Threading.Channels" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="System.Threading.Channels" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="System.Threading.RateLimiting" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="System.Threading.RateLimiting" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.Extensions.DependencyModel" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.Extensions.DependencyModel" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.NETCore.App.Ref" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.NETCore.App.Ref" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.NET.Runtime.MonoAOTCompiler.Task" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.NET.Runtime.MonoAOTCompiler.Task" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.NET.Runtime.WebAssembly.Sdk" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.NET.Runtime.WebAssembly.Sdk" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
<!--
Win-x64 is used here because we have picked an arbitrary runtime identifier to flow the version of the latest NETCore.App runtime.
All Runtime.$rid packages should have the same version.
-->
- <Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.NETCore.BrowserDebugHost.Transport" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.NETCore.BrowserDebugHost.Transport" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<!-- Listed explicitly to workaround https://github.com/dotnet/cli/issues/10528 -->
- <Dependency Name="Microsoft.NETCore.Platforms" Version="7.0.0-preview.6.22281.7">
+ <Dependency Name="Microsoft.NETCore.Platforms" Version="7.0.0-preview.6.22306.7">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>06da0fcf4573115aac76f4afd65cdd75592e86e2</Sha>
+ <Sha>eef6c7f6cb7f73163313d349fbb796f37b4c3996</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.22276.1">
+ <Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.22301.2">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>b8b67b243ba93bf9b89390c85b4dee034d3c5609</Sha>
+ <Sha>7ffde50ec98dbe3584bef2375165ec9a6b39cb35</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
- <Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="7.0.0-beta.22276.1">
+ <Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="7.0.0-beta.22301.2">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>b8b67b243ba93bf9b89390c85b4dee034d3c5609</Sha>
+ <Sha>7ffde50ec98dbe3584bef2375165ec9a6b39cb35</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.Build.Tasks.Templating" Version="7.0.0-beta.22276.1">
+ <Dependency Name="Microsoft.DotNet.Build.Tasks.Templating" Version="7.0.0-beta.22301.2">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>b8b67b243ba93bf9b89390c85b4dee034d3c5609</Sha>
+ <Sha>7ffde50ec98dbe3584bef2375165ec9a6b39cb35</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="7.0.0-beta.22276.1">
+ <Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="7.0.0-beta.22301.2">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>b8b67b243ba93bf9b89390c85b4dee034d3c5609</Sha>
+ <Sha>7ffde50ec98dbe3584bef2375165ec9a6b39cb35</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
diff --git a/eng/Versions.props b/eng/Versions.props
index 6ec45758c6..d2625574e8 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -63,80 +63,80 @@
-->
<PropertyGroup Label="Automated">
<!-- Packages from dotnet/runtime -->
- <MicrosoftExtensionsDependencyModelVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsDependencyModelVersion>
- <MicrosoftNETCoreAppRefVersion>7.0.0-preview.6.22281.7</MicrosoftNETCoreAppRefVersion>
- <MicrosoftNETCoreAppRuntimewinx64Version>7.0.0-preview.6.22281.7</MicrosoftNETCoreAppRuntimewinx64Version>
- <MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>7.0.0-preview.6.22281.7</MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>
- <MicrosoftNETRuntimeWebAssemblySdkVersion>7.0.0-preview.6.22281.7</MicrosoftNETRuntimeWebAssemblySdkVersion>
- <MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>7.0.0-preview.6.22281.7</MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>
- <MicrosoftNETCoreBrowserDebugHostTransportVersion>7.0.0-preview.6.22281.7</MicrosoftNETCoreBrowserDebugHostTransportVersion>
- <MicrosoftExtensionsCachingAbstractionsVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsCachingAbstractionsVersion>
- <MicrosoftExtensionsCachingMemoryVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsCachingMemoryVersion>
- <MicrosoftExtensionsConfigurationAbstractionsVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsConfigurationAbstractionsVersion>
- <MicrosoftExtensionsConfigurationBinderVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsConfigurationBinderVersion>
- <MicrosoftExtensionsConfigurationCommandLineVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsConfigurationCommandLineVersion>
- <MicrosoftExtensionsConfigurationEnvironmentVariablesVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsConfigurationEnvironmentVariablesVersion>
- <MicrosoftExtensionsConfigurationFileExtensionsVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsConfigurationFileExtensionsVersion>
- <MicrosoftExtensionsConfigurationIniVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsConfigurationIniVersion>
- <MicrosoftExtensionsConfigurationJsonVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsConfigurationJsonVersion>
- <MicrosoftExtensionsConfigurationVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsConfigurationVersion>
- <MicrosoftExtensionsConfigurationUserSecretsVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsConfigurationUserSecretsVersion>
- <MicrosoftExtensionsConfigurationXmlVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsConfigurationXmlVersion>
- <MicrosoftExtensionsDependencyInjectionAbstractionsVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsDependencyInjectionAbstractionsVersion>
- <MicrosoftExtensionsDependencyInjectionVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsDependencyInjectionVersion>
- <MicrosoftExtensionsFileProvidersAbstractionsVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsFileProvidersAbstractionsVersion>
- <MicrosoftExtensionsFileProvidersCompositeVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsFileProvidersCompositeVersion>
- <MicrosoftExtensionsFileProvidersPhysicalVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsFileProvidersPhysicalVersion>
- <MicrosoftExtensionsFileSystemGlobbingVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsFileSystemGlobbingVersion>
- <MicrosoftExtensionsHostFactoryResolverSourcesVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsHostFactoryResolverSourcesVersion>
- <MicrosoftExtensionsHostingAbstractionsVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsHostingAbstractionsVersion>
- <MicrosoftExtensionsHostingVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsHostingVersion>
- <MicrosoftExtensionsHttpVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsHttpVersion>
- <MicrosoftExtensionsLoggingAbstractionsVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsLoggingAbstractionsVersion>
- <MicrosoftExtensionsLoggingConfigurationVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsLoggingConfigurationVersion>
- <MicrosoftExtensionsLoggingConsoleVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsLoggingConsoleVersion>
- <MicrosoftExtensionsLoggingDebugVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsLoggingDebugVersion>
- <MicrosoftExtensionsLoggingEventSourceVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsLoggingEventSourceVersion>
- <MicrosoftExtensionsLoggingEventLogVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsLoggingEventLogVersion>
- <MicrosoftExtensionsLoggingVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsLoggingVersion>
- <MicrosoftExtensionsLoggingTraceSourceVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsLoggingTraceSourceVersion>
- <MicrosoftExtensionsOptionsConfigurationExtensionsVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsOptionsConfigurationExtensionsVersion>
- <MicrosoftExtensionsOptionsDataAnnotationsVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsOptionsDataAnnotationsVersion>
- <MicrosoftExtensionsOptionsVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsOptionsVersion>
- <MicrosoftExtensionsPrimitivesVersion>7.0.0-preview.6.22281.7</MicrosoftExtensionsPrimitivesVersion>
- <MicrosoftInternalRuntimeAspNetCoreTransportVersion>7.0.0-preview.6.22281.7</MicrosoftInternalRuntimeAspNetCoreTransportVersion>
- <SystemConfigurationConfigurationManagerVersion>7.0.0-preview.6.22281.7</SystemConfigurationConfigurationManagerVersion>
- <SystemDiagnosticsDiagnosticSourceVersion>7.0.0-preview.6.22281.7</SystemDiagnosticsDiagnosticSourceVersion>
- <SystemDiagnosticsEventLogVersion>7.0.0-preview.6.22281.7</SystemDiagnosticsEventLogVersion>
- <SystemDirectoryServicesProtocolsVersion>7.0.0-preview.6.22281.7</SystemDirectoryServicesProtocolsVersion>
- <SystemIOPipelinesVersion>7.0.0-preview.6.22281.7</SystemIOPipelinesVersion>
- <SystemNetHttpJsonVersion>7.0.0-preview.6.22281.7</SystemNetHttpJsonVersion>
- <SystemNetHttpWinHttpHandlerVersion>7.0.0-preview.6.22281.7</SystemNetHttpWinHttpHandlerVersion>
- <SystemReflectionMetadataVersion>7.0.0-preview.6.22281.7</SystemReflectionMetadataVersion>
- <SystemResourcesExtensionsVersion>7.0.0-preview.6.22281.7</SystemResourcesExtensionsVersion>
- <SystemSecurityCryptographyPkcsVersion>7.0.0-preview.6.22281.7</SystemSecurityCryptographyPkcsVersion>
- <SystemSecurityCryptographyXmlVersion>7.0.0-preview.6.22281.7</SystemSecurityCryptographyXmlVersion>
- <SystemSecurityPermissionsVersion>7.0.0-preview.6.22281.7</SystemSecurityPermissionsVersion>
- <SystemServiceProcessServiceControllerVersion>7.0.0-preview.6.22281.7</SystemServiceProcessServiceControllerVersion>
- <SystemTextEncodingsWebVersion>7.0.0-preview.6.22281.7</SystemTextEncodingsWebVersion>
- <SystemTextJsonVersion>7.0.0-preview.6.22281.7</SystemTextJsonVersion>
- <SystemThreadingAccessControlVersion>7.0.0-preview.6.22281.7</SystemThreadingAccessControlVersion>
- <SystemThreadingChannelsVersion>7.0.0-preview.6.22281.7</SystemThreadingChannelsVersion>
- <SystemThreadingRateLimitingVersion>7.0.0-preview.6.22281.7</SystemThreadingRateLimitingVersion>
+ <MicrosoftExtensionsDependencyModelVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsDependencyModelVersion>
+ <MicrosoftNETCoreAppRefVersion>7.0.0-preview.6.22306.7</MicrosoftNETCoreAppRefVersion>
+ <MicrosoftNETCoreAppRuntimewinx64Version>7.0.0-preview.6.22306.7</MicrosoftNETCoreAppRuntimewinx64Version>
+ <MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>7.0.0-preview.6.22306.7</MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>
+ <MicrosoftNETRuntimeWebAssemblySdkVersion>7.0.0-preview.6.22306.7</MicrosoftNETRuntimeWebAssemblySdkVersion>
+ <MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>7.0.0-preview.6.22306.7</MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>
+ <MicrosoftNETCoreBrowserDebugHostTransportVersion>7.0.0-preview.6.22306.7</MicrosoftNETCoreBrowserDebugHostTransportVersion>
+ <MicrosoftExtensionsCachingAbstractionsVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsCachingAbstractionsVersion>
+ <MicrosoftExtensionsCachingMemoryVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsCachingMemoryVersion>
+ <MicrosoftExtensionsConfigurationAbstractionsVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsConfigurationAbstractionsVersion>
+ <MicrosoftExtensionsConfigurationBinderVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsConfigurationBinderVersion>
+ <MicrosoftExtensionsConfigurationCommandLineVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsConfigurationCommandLineVersion>
+ <MicrosoftExtensionsConfigurationEnvironmentVariablesVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsConfigurationEnvironmentVariablesVersion>
+ <MicrosoftExtensionsConfigurationFileExtensionsVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsConfigurationFileExtensionsVersion>
+ <MicrosoftExtensionsConfigurationIniVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsConfigurationIniVersion>
+ <MicrosoftExtensionsConfigurationJsonVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsConfigurationJsonVersion>
+ <MicrosoftExtensionsConfigurationVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsConfigurationVersion>
+ <MicrosoftExtensionsConfigurationUserSecretsVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsConfigurationUserSecretsVersion>
+ <MicrosoftExtensionsConfigurationXmlVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsConfigurationXmlVersion>
+ <MicrosoftExtensionsDependencyInjectionAbstractionsVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsDependencyInjectionAbstractionsVersion>
+ <MicrosoftExtensionsDependencyInjectionVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsDependencyInjectionVersion>
+ <MicrosoftExtensionsFileProvidersAbstractionsVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsFileProvidersAbstractionsVersion>
+ <MicrosoftExtensionsFileProvidersCompositeVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsFileProvidersCompositeVersion>
+ <MicrosoftExtensionsFileProvidersPhysicalVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsFileProvidersPhysicalVersion>
+ <MicrosoftExtensionsFileSystemGlobbingVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsFileSystemGlobbingVersion>
+ <MicrosoftExtensionsHostFactoryResolverSourcesVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsHostFactoryResolverSourcesVersion>
+ <MicrosoftExtensionsHostingAbstractionsVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsHostingAbstractionsVersion>
+ <MicrosoftExtensionsHostingVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsHostingVersion>
+ <MicrosoftExtensionsHttpVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsHttpVersion>
+ <MicrosoftExtensionsLoggingAbstractionsVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsLoggingAbstractionsVersion>
+ <MicrosoftExtensionsLoggingConfigurationVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsLoggingConfigurationVersion>
+ <MicrosoftExtensionsLoggingConsoleVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsLoggingConsoleVersion>
+ <MicrosoftExtensionsLoggingDebugVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsLoggingDebugVersion>
+ <MicrosoftExtensionsLoggingEventSourceVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsLoggingEventSourceVersion>
+ <MicrosoftExtensionsLoggingEventLogVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsLoggingEventLogVersion>
+ <MicrosoftExtensionsLoggingVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsLoggingVersion>
+ <MicrosoftExtensionsLoggingTraceSourceVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsLoggingTraceSourceVersion>
+ <MicrosoftExtensionsOptionsConfigurationExtensionsVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsOptionsConfigurationExtensionsVersion>
+ <MicrosoftExtensionsOptionsDataAnnotationsVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsOptionsDataAnnotationsVersion>
+ <MicrosoftExtensionsOptionsVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsOptionsVersion>
+ <MicrosoftExtensionsPrimitivesVersion>7.0.0-preview.6.22306.7</MicrosoftExtensionsPrimitivesVersion>
+ <MicrosoftInternalRuntimeAspNetCoreTransportVersion>7.0.0-preview.6.22306.7</MicrosoftInternalRuntimeAspNetCoreTransportVersion>
+ <SystemConfigurationConfigurationManagerVersion>7.0.0-preview.6.22306.7</SystemConfigurationConfigurationManagerVersion>
+ <SystemDiagnosticsDiagnosticSourceVersion>7.0.0-preview.6.22306.7</SystemDiagnosticsDiagnosticSourceVersion>
+ <SystemDiagnosticsEventLogVersion>7.0.0-preview.6.22306.7</SystemDiagnosticsEventLogVersion>
+ <SystemDirectoryServicesProtocolsVersion>7.0.0-preview.6.22306.7</SystemDirectoryServicesProtocolsVersion>
+ <SystemIOPipelinesVersion>7.0.0-preview.6.22306.7</SystemIOPipelinesVersion>
+ <SystemNetHttpJsonVersion>7.0.0-preview.6.22306.7</SystemNetHttpJsonVersion>
+ <SystemNetHttpWinHttpHandlerVersion>7.0.0-preview.6.22306.7</SystemNetHttpWinHttpHandlerVersion>
+ <SystemReflectionMetadataVersion>7.0.0-preview.6.22306.7</SystemReflectionMetadataVersion>
+ <SystemResourcesExtensionsVersion>7.0.0-preview.6.22306.7</SystemResourcesExtensionsVersion>
+ <SystemSecurityCryptographyPkcsVersion>7.0.0-preview.6.22306.7</SystemSecurityCryptographyPkcsVersion>
+ <SystemSecurityCryptographyXmlVersion>7.0.0-preview.6.22306.7</SystemSecurityCryptographyXmlVersion>
+ <SystemSecurityPermissionsVersion>7.0.0-preview.6.22306.7</SystemSecurityPermissionsVersion>
+ <SystemServiceProcessServiceControllerVersion>7.0.0-preview.6.22306.7</SystemServiceProcessServiceControllerVersion>
+ <SystemTextEncodingsWebVersion>7.0.0-preview.6.22306.7</SystemTextEncodingsWebVersion>
+ <SystemTextJsonVersion>7.0.0-preview.6.22306.7</SystemTextJsonVersion>
+ <SystemThreadingAccessControlVersion>7.0.0-preview.6.22306.7</SystemThreadingAccessControlVersion>
+ <SystemThreadingChannelsVersion>7.0.0-preview.6.22306.7</SystemThreadingChannelsVersion>
+ <SystemThreadingRateLimitingVersion>7.0.0-preview.6.22306.7</SystemThreadingRateLimitingVersion>
<!-- Only listed explicitly to workaround https://github.com/dotnet/cli/issues/10528 -->
- <MicrosoftNETCorePlatformsVersion>7.0.0-preview.6.22281.7</MicrosoftNETCorePlatformsVersion>
+ <MicrosoftNETCorePlatformsVersion>7.0.0-preview.6.22306.7</MicrosoftNETCorePlatformsVersion>
<!-- Packages from dotnet/efcore -->
- <dotnetefVersion>7.0.0-preview.6.22301.1</dotnetefVersion>
- <MicrosoftEntityFrameworkCoreInMemoryVersion>7.0.0-preview.6.22301.1</MicrosoftEntityFrameworkCoreInMemoryVersion>
- <MicrosoftEntityFrameworkCoreRelationalVersion>7.0.0-preview.6.22301.1</MicrosoftEntityFrameworkCoreRelationalVersion>
- <MicrosoftEntityFrameworkCoreSqliteVersion>7.0.0-preview.6.22301.1</MicrosoftEntityFrameworkCoreSqliteVersion>
- <MicrosoftEntityFrameworkCoreSqlServerVersion>7.0.0-preview.6.22301.1</MicrosoftEntityFrameworkCoreSqlServerVersion>
- <MicrosoftEntityFrameworkCoreToolsVersion>7.0.0-preview.6.22301.1</MicrosoftEntityFrameworkCoreToolsVersion>
- <MicrosoftEntityFrameworkCoreVersion>7.0.0-preview.6.22301.1</MicrosoftEntityFrameworkCoreVersion>
- <MicrosoftEntityFrameworkCoreDesignVersion>7.0.0-preview.6.22301.1</MicrosoftEntityFrameworkCoreDesignVersion>
+ <dotnetefVersion>7.0.0-preview.6.22302.1</dotnetefVersion>
+ <MicrosoftEntityFrameworkCoreInMemoryVersion>7.0.0-preview.6.22302.1</MicrosoftEntityFrameworkCoreInMemoryVersion>
+ <MicrosoftEntityFrameworkCoreRelationalVersion>7.0.0-preview.6.22302.1</MicrosoftEntityFrameworkCoreRelationalVersion>
+ <MicrosoftEntityFrameworkCoreSqliteVersion>7.0.0-preview.6.22302.1</MicrosoftEntityFrameworkCoreSqliteVersion>
+ <MicrosoftEntityFrameworkCoreSqlServerVersion>7.0.0-preview.6.22302.1</MicrosoftEntityFrameworkCoreSqlServerVersion>
+ <MicrosoftEntityFrameworkCoreToolsVersion>7.0.0-preview.6.22302.1</MicrosoftEntityFrameworkCoreToolsVersion>
+ <MicrosoftEntityFrameworkCoreVersion>7.0.0-preview.6.22302.1</MicrosoftEntityFrameworkCoreVersion>
+ <MicrosoftEntityFrameworkCoreDesignVersion>7.0.0-preview.6.22302.1</MicrosoftEntityFrameworkCoreDesignVersion>
<!-- Packages from dotnet/arcade -->
- <MicrosoftDotNetBuildTasksInstallersVersion>7.0.0-beta.22276.1</MicrosoftDotNetBuildTasksInstallersVersion>
- <MicrosoftDotNetBuildTasksTemplatingVersion>7.0.0-beta.22276.1</MicrosoftDotNetBuildTasksTemplatingVersion>
+ <MicrosoftDotNetBuildTasksInstallersVersion>7.0.0-beta.22301.2</MicrosoftDotNetBuildTasksInstallersVersion>
+ <MicrosoftDotNetBuildTasksTemplatingVersion>7.0.0-beta.22301.2</MicrosoftDotNetBuildTasksTemplatingVersion>
</PropertyGroup>
<!--
@@ -204,8 +204,8 @@
<MicrosoftCodeAnalysisCSharpVersion>4.2.0-2.22128.1</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesVersion>4.2.0-2.22128.1</MicrosoftCodeAnalysisCSharpWorkspacesVersion>
<MicrosoftCodeAnalysisPublicApiAnalyzersVersion>3.3.0</MicrosoftCodeAnalysisPublicApiAnalyzersVersion>
- <MicrosoftCodeAnalysisCSharpAnalyzerTestingXUnitVersion>1.1.1-beta1.21413.1</MicrosoftCodeAnalysisCSharpAnalyzerTestingXUnitVersion>
- <MicrosoftCodeAnalysisCSharpCodeFixTestingXUnitVersion>1.1.1-beta1.21413.1</MicrosoftCodeAnalysisCSharpCodeFixTestingXUnitVersion>
+ <MicrosoftCodeAnalysisCSharpAnalyzerTestingXUnitVersion>1.1.2-beta1.22276.1</MicrosoftCodeAnalysisCSharpAnalyzerTestingXUnitVersion>
+ <MicrosoftCodeAnalysisCSharpCodeFixTestingXUnitVersion>1.1.2-beta1.22276.1</MicrosoftCodeAnalysisCSharpCodeFixTestingXUnitVersion>
<MicrosoftCssParserVersion>1.0.0-20200708.1</MicrosoftCssParserVersion>
<MicrosoftIdentityModelLoggingVersion>6.15.1</MicrosoftIdentityModelLoggingVersion>
<MicrosoftIdentityModelProtocolsOpenIdConnectVersion>6.15.1</MicrosoftIdentityModelProtocolsOpenIdConnectVersion>
diff --git a/eng/Workarounds.props b/eng/Workarounds.props
index 0718781a8d..a9561f8376 100644
--- a/eng/Workarounds.props
+++ b/eng/Workarounds.props
@@ -42,10 +42,4 @@
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
</PropertyGroup>
- <!-- Trim analyzers are automatically enabled by IsTrimming=true. They currently break when run on aspnetcore.
- Remove when trimming analyzers are fixed: https://github.com/dotnet/aspnetcore/issues/41016 -->
- <PropertyGroup>
- <EnableTrimAnalyzer Condition=" '$(EnableTrimAnalyzer)' == ''">false</EnableTrimAnalyzer>
- </PropertyGroup>
-
</Project>
diff --git a/eng/helix/helix.proj b/eng/helix/helix.proj
index e07da3d710..3d429e3b16 100644
--- a/eng/helix/helix.proj
+++ b/eng/helix/helix.proj
@@ -39,6 +39,13 @@
>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts', 'bin'))</ArtifactsBinDir>
<OutputPath Condition=" '$(OutputPath)' == '' "
>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', '$(MSBuildProjectName)'))</OutputPath>
+
+ <!--
+ Define $(HelixTestConfigurationFilePath) so the Helix SDK automatically includes our test config file in the
+ correlation payload. The Helix SDK has a fallback value that doesn't work w/o including the Arcade SDK and
+ we intentionally do not do that in this project.
+ -->
+ <HelixTestConfigurationFilePath>$(RepoRoot)eng/test-configuration.json</HelixTestConfigurationFilePath>
</PropertyGroup>
<!-- Specify the .NET runtime we need which will be included as a correlation payload. -->
diff --git a/eng/test-configuration.json b/eng/test-configuration.json
index 66a8c0f249..d732a26ac5 100644
--- a/eng/test-configuration.json
+++ b/eng/test-configuration.json
@@ -8,7 +8,8 @@
{"testName": {"contains": "ReaderThrowsResetExceptionOnInvalidBody" }},
{"testAssembly": {"wildcard": "IIS*Tests*"}},
{"testAssembly": {"wildcard": "IIS.ShadowCopy.Tests*"}},
- {"failureMessage": "network disconnected" }
+ {"failureMessage": {"contains":"System.AggregateException : One or more errors occurred. (Operation did not succeed after 15 retries (Site is started but no worker process found) (Site is started but no worker process found)"}},
+ {"failureMessage": {"contains": "network disconnected"}}
],
"failOnRules": [
],
diff --git a/global.json b/global.json
index 12586ce8b5..bee5555766 100644
--- a/global.json
+++ b/global.json
@@ -27,7 +27,7 @@
},
"msbuild-sdks": {
"Yarn.MSBuild": "1.22.10",
- "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22276.1",
- "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.22276.1"
+ "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22301.2",
+ "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.22301.2"
}
}
diff --git a/src/Components/Components/src/BindConverter.cs b/src/Components/Components/src/BindConverter.cs
index bffc60a76e..dffc03107d 100644
--- a/src/Components/Components/src/BindConverter.cs
+++ b/src/Components/Components/src/BindConverter.cs
@@ -1826,6 +1826,7 @@ public static class BindConverter
}
}
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "We expect unknown underlying types are configured by application code to be retained.")]
private static BindFormatter<T> MakeTypeConverterFormatter<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>()
{
var typeConverter = TypeDescriptor.GetConverter(typeof(T));
@@ -2028,6 +2029,7 @@ public static class BindConverter
}
}
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "We expect unknown underlying types are configured by application code to be retained.")]
private static BindParser<T> MakeTypeConverterConverter<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>()
{
var typeConverter = TypeDescriptor.GetConverter(typeof(T));
diff --git a/src/Components/Components/src/CascadingParameterState.cs b/src/Components/Components/src/CascadingParameterState.cs
index 1296f251c2..0430fbe9ae 100644
--- a/src/Components/Components/src/CascadingParameterState.cs
+++ b/src/Components/Components/src/CascadingParameterState.cs
@@ -6,6 +6,7 @@ using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using Microsoft.AspNetCore.Components.Reflection;
using Microsoft.AspNetCore.Components.Rendering;
+using static Microsoft.AspNetCore.Internal.LinkerFlags;
namespace Microsoft.AspNetCore.Components;
@@ -75,7 +76,7 @@ internal readonly struct CascadingParameterState
}
private static ReflectedCascadingParameterInfo[] GetReflectedCascadingParameterInfos(
- [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type componentType)
+ [DynamicallyAccessedMembers(Component)] Type componentType)
{
if (!_cachedInfos.TryGetValue(componentType, out var infos))
{
@@ -87,7 +88,7 @@ internal readonly struct CascadingParameterState
}
private static ReflectedCascadingParameterInfo[] CreateReflectedCascadingParameterInfos(
- [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type componentType)
+ [DynamicallyAccessedMembers(Component)] Type componentType)
{
List<ReflectedCascadingParameterInfo>? result = null;
var candidateProps = ComponentProperties.GetCandidateBindableProperties(componentType);
diff --git a/src/Components/Components/src/DynamicComponent.cs b/src/Components/Components/src/DynamicComponent.cs
index 2941b024a4..35252350bb 100644
--- a/src/Components/Components/src/DynamicComponent.cs
+++ b/src/Components/Components/src/DynamicComponent.cs
@@ -59,6 +59,7 @@ public class DynamicComponent : IComponent
}
/// <inheritdoc />
+ [UnconditionalSuppressMessage("Trimming", "IL2072", Justification = "We expect that types used with DynamicComponent will be defined in assemblies that don't get trimmed.")]
public Task SetParametersAsync(ParameterView parameters)
{
// This manual parameter assignment logic will be marginally faster than calling
diff --git a/src/Components/Components/src/LayoutAttribute.cs b/src/Components/Components/src/LayoutAttribute.cs
index e5f7baa9d2..b7249f82c6 100644
--- a/src/Components/Components/src/LayoutAttribute.cs
+++ b/src/Components/Components/src/LayoutAttribute.cs
@@ -1,6 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.Diagnostics.CodeAnalysis;
+using static Microsoft.AspNetCore.Internal.LinkerFlags;
+
namespace Microsoft.AspNetCore.Components;
/// <summary>
@@ -13,7 +16,7 @@ public sealed class LayoutAttribute : Attribute
/// Constructs an instance of <see cref="LayoutAttribute"/>.
/// </summary>
/// <param name="layoutType">The type of the layout.</param>
- public LayoutAttribute(Type layoutType)
+ public LayoutAttribute([DynamicallyAccessedMembers(Component)] Type layoutType)
{
LayoutType = layoutType ?? throw new ArgumentNullException(nameof(layoutType));
diff --git a/src/Components/Components/src/LayoutView.cs b/src/Components/Components/src/LayoutView.cs
index de5025d6cc..60fa323cd9 100644
--- a/src/Components/Components/src/LayoutView.cs
+++ b/src/Components/Components/src/LayoutView.cs
@@ -46,6 +46,7 @@ public class LayoutView : IComponent
return Task.CompletedTask;
}
+ [UnconditionalSuppressMessage("Trimming", "IL2072", Justification = "Layout components are preserved because the LayoutAttribute constructor parameter is correctly annotated.")]
private void Render()
{
// In the middle goes the supplied content
diff --git a/src/Components/Components/src/RouteView.cs b/src/Components/Components/src/RouteView.cs
index 66336d4fb4..3fb7d853a7 100644
--- a/src/Components/Components/src/RouteView.cs
+++ b/src/Components/Components/src/RouteView.cs
@@ -3,6 +3,7 @@
#nullable disable warnings
+using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using Microsoft.AspNetCore.Components.Rendering;
using Microsoft.AspNetCore.Components.Routing;
@@ -72,6 +73,7 @@ public class RouteView : IComponent
/// Renders the component.
/// </summary>
/// <param name="builder">The <see cref="RenderTreeBuilder"/>.</param>
+ [UnconditionalSuppressMessage("Trimming", "IL2111", Justification = "Layout components are preserved because the LayoutAttribute constructor parameter is correctly annotated.")]
protected virtual void Render(RenderTreeBuilder builder)
{
var pageLayoutType = RouteData.PageType.GetCustomAttribute<LayoutAttribute>()?.LayoutType
diff --git a/src/Components/Components/src/Routing/RouteTableFactory.cs b/src/Components/Components/src/Routing/RouteTableFactory.cs
index 34ecb8fb03..de6d8f2bb9 100644
--- a/src/Components/Components/src/Routing/RouteTableFactory.cs
+++ b/src/Components/Components/src/Routing/RouteTableFactory.cs
@@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Concurrent;
+using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using Microsoft.AspNetCore.Components.Routing;
@@ -30,6 +31,7 @@ internal static class RouteTableFactory
public static void ClearCaches() => Cache.Clear();
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Application code does not get trimmed, and the framework does not define routable components.")]
private static List<Type> GetRouteableComponents(RouteKey routeKey)
{
var routeableComponents = new List<Type>();
diff --git a/src/Components/Forms/src/EditContextDataAnnotationsExtensions.cs b/src/Components/Forms/src/EditContextDataAnnotationsExtensions.cs
index 981c452127..7a926e0ee8 100644
--- a/src/Components/Forms/src/EditContextDataAnnotationsExtensions.cs
+++ b/src/Components/Forms/src/EditContextDataAnnotationsExtensions.cs
@@ -83,6 +83,7 @@ public static class EditContextDataAnnotationsExtensions
}
}
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Model types are expected to be defined in assemblies that do not get trimmed.")]
private void OnFieldChanged(object? sender, FieldChangedEventArgs eventArgs)
{
var fieldIdentifier = eventArgs.FieldIdentifier;
@@ -108,6 +109,7 @@ public static class EditContextDataAnnotationsExtensions
}
}
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Model types are expected to be defined in assemblies that do not get trimmed.")]
private void OnValidationRequested(object? sender, ValidationRequestedEventArgs e)
{
var validationContext = new ValidationContext(_editContext.Model, _serviceProvider, items: null);
@@ -152,6 +154,7 @@ public static class EditContextDataAnnotationsExtensions
}
}
+ [UnconditionalSuppressMessage("Trimming", "IL2080", Justification = "Model types are expected to be defined in assemblies that do not get trimmed.")]
private static bool TryGetValidatableProperty(in FieldIdentifier fieldIdentifier, [NotNullWhen(true)] out PropertyInfo? propertyInfo)
{
var cacheKey = (ModelType: fieldIdentifier.Model.GetType(), fieldIdentifier.FieldName);
diff --git a/src/Components/Shared/src/ComponentParametersTypeCache.cs b/src/Components/Shared/src/ComponentParametersTypeCache.cs
index a0e14ff1d8..6d0992362c 100644
--- a/src/Components/Shared/src/ComponentParametersTypeCache.cs
+++ b/src/Components/Shared/src/ComponentParametersTypeCache.cs
@@ -24,7 +24,7 @@ internal sealed class ComponentParametersTypeCache
}
}
- [RequiresUnreferencedCode("This type attempts to load component parameters that may be trimmed.")]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "We expect application code is configured to preserve component parameters.")]
private static Type? ResolveType(Key key, Assembly[] assemblies)
{
Assembly? assembly = null;
diff --git a/src/Components/Shared/src/RootComponentTypeCache.cs b/src/Components/Shared/src/RootComponentTypeCache.cs
index a93ecc351f..9949bf5fae 100644
--- a/src/Components/Shared/src/RootComponentTypeCache.cs
+++ b/src/Components/Shared/src/RootComponentTypeCache.cs
@@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Concurrent;
+using System.Diagnostics.CodeAnalysis;
using System.Reflection;
namespace Microsoft.AspNetCore.Components;
@@ -24,6 +25,7 @@ internal sealed class RootComponentTypeCache
}
}
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Root components are expected to be defined in assemblies that do not get trimmed.")]
private static Type? ResolveType(Key key, Assembly[] assemblies)
{
Assembly? assembly = null;
diff --git a/src/Components/Web.JS/package.json b/src/Components/Web.JS/package.json
index 5be59b17d6..f4bbf03798 100644
--- a/src/Components/Web.JS/package.json
+++ b/src/Components/Web.JS/package.json
@@ -36,8 +36,5 @@
"typescript": "^4.5.4",
"webpack": "^5.72.1",
"webpack-cli": "^4.9.2"
- },
- "resolutions": {
- "url-parse": ">=1.5.6"
}
}
diff --git a/src/Components/Web.JS/yarn.lock b/src/Components/Web.JS/yarn.lock
index 823a2ae14b..1c2c26ed94 100644
--- a/src/Components/Web.JS/yarn.lock
+++ b/src/Components/Web.JS/yarn.lock
@@ -1748,12 +1748,10 @@ events@^3.2.0:
resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400"
integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==
-eventsource@^1.0.7:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-1.1.0.tgz#00e8ca7c92109e94b0ddf32dac677d841028cfaf"
- integrity sha512-VSJjT5oCNrFvCS6igjzPAt5hBzQ2qPBFIbJ03zLI9SE0mxwZpMw6BfJrbFHm1a141AavMEB8JHmBhWAd66PfCg==
- dependencies:
- original "^1.0.0"
+eventsource@^2.0.2:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-2.0.2.tgz#76dfcc02930fb2ff339520b6d290da573a9e8508"
+ integrity sha512-IzUmBGPR3+oUG9dUeXynyNmf91/3zUSJg1lCktzKw47OXuhco54U3r9B7O4XX+Rb1Itm9OZ2b0RkTs10bICOxA==
execa@^5.0.0:
version "5.1.1"
@@ -1808,12 +1806,13 @@ fastq@^1.6.0:
dependencies:
reusify "^1.0.4"
-fetch-cookie@^0.11.0:
- version "0.11.0"
- resolved "https://registry.yarnpkg.com/fetch-cookie/-/fetch-cookie-0.11.0.tgz#e046d2abadd0ded5804ce7e2cae06d4331c15407"
- integrity sha512-BQm7iZLFhMWFy5CZ/162sAGjBfdNWb7a8LEqqnzsHFhxT/X/SVj/z2t2nu3aJvjlbQkrAlTUApplPRjWyH4mhA==
+fetch-cookie@^2.0.3:
+ version "2.0.5"
+ resolved "https://registry.yarnpkg.com/fetch-cookie/-/fetch-cookie-2.0.5.tgz#d49b0886f79c71ce927245d928b9c230a2ddc69e"
+ integrity sha512-zsX/vrrLLCrLUKS/45u/NqZDwRSyopUscM/0huSH5clYe8dmkxIiDs3g4po+f5baWiXiTAOqPMtflP80CtR5rA==
dependencies:
- tough-cookie "^2.3.3 || ^3.0.1 || ^4.0.0"
+ set-cookie-parser "^2.4.8"
+ tough-cookie "^4.0.0"
file-entry-cache@^6.0.1:
version "6.0.1"
@@ -2321,13 +2320,6 @@ optionator@^0.9.1:
type-check "^0.4.0"
word-wrap "^1.2.3"
-original@^1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/original/-/original-1.0.2.tgz#e442a61cffe1c5fd20a65f3261c26663b303f25f"
- integrity sha512-hyBVl6iqqUOJ8FqRe+l/gS8H+kKYjrEndd5Pm1MfBtsEKA038HkkdbAl/72EAXGyonD/PFsvmVG+EvcIpliMBg==
- dependencies:
- url-parse "^1.4.3"
-
p-limit@^2.2.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1"
@@ -2416,11 +2408,6 @@ punycode@^2.1.0, punycode@^2.1.1:
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
-querystringify@^2.1.1:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6"
- integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==
-
queue-microtask@^1.2.2:
version "1.2.3"
resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"
@@ -2498,11 +2485,6 @@ require-directory@^2.1.1:
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I=
-requires-port@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
- integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=
-
resolve-cwd@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d"
@@ -2603,6 +2585,11 @@ serialize-javascript@^6.0.0:
dependencies:
randombytes "^2.1.0"
+set-cookie-parser@^2.4.8:
+ version "2.4.8"
+ resolved "https://registry.yarnpkg.com/set-cookie-parser/-/set-cookie-parser-2.4.8.tgz#d0da0ed388bc8f24e706a391f9c9e252a13c58b2"
+ integrity sha512-edRH8mBKEWNVIVMKejNnuJxleqYE/ZSdcT8/Nem9/mmosx12pctd80s2Oy00KNZzrogMZS5mauK2/ymL1bvlvg==
+
shallow-clone@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3"
@@ -2767,7 +2754,7 @@ to-regex-range@^5.0.1:
dependencies:
is-number "^7.0.0"
-"tough-cookie@^2.3.3 || ^3.0.1 || ^4.0.0":
+tough-cookie@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.0.0.tgz#d822234eeca882f991f0f908824ad2622ddbece4"
integrity sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==
@@ -2862,14 +2849,6 @@ uri-js@^4.2.2:
dependencies:
punycode "^2.1.0"
-url-parse@>=1.5.6, url-parse@^1.4.3:
- version "1.5.10"
- resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1"
- integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==
- dependencies:
- querystringify "^2.1.1"
- requires-port "^1.0.0"
-
v8-compile-cache@^2.0.3:
version "2.3.0"
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee"
diff --git a/src/Components/Web/src/JSComponents/JSComponentInterop.cs b/src/Components/Web/src/JSComponents/JSComponentInterop.cs
index 42f002ff1e..d00bbf2baa 100644
--- a/src/Components/Web/src/JSComponents/JSComponentInterop.cs
+++ b/src/Components/Web/src/JSComponents/JSComponentInterop.cs
@@ -178,6 +178,7 @@ public class JSComponentInterop
return new(null, callback);
}
+ [UnconditionalSuppressMessage("Trimming", "IL2067", Justification = "EventCallback and EventCallback<TValue> constructors are referenced statically and will be preserved.")]
private static object CreateEventCallbackWithSingleParameter(Type eventCallbackType, IJSObjectReference? jsObjectReference)
{
var callback = jsObjectReference is null ? null : new Func<object, Task>(
@@ -195,6 +196,7 @@ public class JSComponentInterop
{
public readonly Dictionary<string, ParameterInfo> ParameterInfoByName;
+ [UnconditionalSuppressMessage("Trimming", "IL2067", Justification = "OpenComponent already has the right set of attributes")]
public ParameterTypeCache(Type componentType)
{
ParameterInfoByName = new(StringComparer.OrdinalIgnoreCase);
diff --git a/src/Components/WebAssembly/WebAssembly/src/Hosting/WebAssemblyHostBuilder.cs b/src/Components/WebAssembly/WebAssembly/src/Hosting/WebAssemblyHostBuilder.cs
index ab0e444230..dca7d0a709 100644
--- a/src/Components/WebAssembly/WebAssembly/src/Hosting/WebAssemblyHostBuilder.cs
+++ b/src/Components/WebAssembly/WebAssembly/src/Hosting/WebAssemblyHostBuilder.cs
@@ -87,6 +87,7 @@ public sealed class WebAssemblyHostBuilder
};
}
+ [UnconditionalSuppressMessage("Trimming", "IL2072", Justification = "Root components are expected to be defined in assemblies that do not get trimmed.")]
private void InitializeRegisteredRootComponents(IJSUnmarshalledRuntime jsRuntime)
{
var componentsCount = jsRuntime.InvokeUnmarshalled<int>(RegisteredComponentsInterop.GetRegisteredComponentsCount);
diff --git a/src/Components/WebAssembly/WebAssembly/src/HotReload/HotReloadAgent.cs b/src/Components/WebAssembly/WebAssembly/src/HotReload/HotReloadAgent.cs
index 23fadd7d01..eac34897a6 100644
--- a/src/Components/WebAssembly/WebAssembly/src/HotReload/HotReloadAgent.cs
+++ b/src/Components/WebAssembly/WebAssembly/src/HotReload/HotReloadAgent.cs
@@ -4,6 +4,7 @@
// Based on the implementation in https://raw.githubusercontent.com/dotnet/sdk/aad0424c0bfaa60c8bd136a92fd131e53d14561a/src/BuiltInTools/DotNetDeltaApplier/HotReloadAgent.cs
using System.Collections.Concurrent;
+using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using System.Reflection.Metadata;
@@ -153,6 +154,7 @@ internal sealed class HotReloadAgent : IDisposable
Visit(assemblies, assembly, sortedAssemblies, visited);
}
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Hot reload is only expected to work when trimming is disabled.")]
static void Visit(Assembly[] assemblies, Assembly assembly, List<Assembly> sortedAssemblies, HashSet<string> visited)
{
var assemblyIdentifier = assembly.GetName().Name!;
@@ -214,6 +216,7 @@ internal sealed class HotReloadAgent : IDisposable
}
}
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Hot reload is only expected to work when trimming is disabled.")]
private static Type[] GetMetadataUpdateTypes(IReadOnlyList<UpdateDelta> deltas)
{
List<Type>? types = null;
diff --git a/src/Components/WebAssembly/WebAssembly/src/Prerendering/ClientComponentParameterDeserializer.cs b/src/Components/WebAssembly/WebAssembly/src/Prerendering/ClientComponentParameterDeserializer.cs
index d6ba299b72..c4b0f4aa9e 100644
--- a/src/Components/WebAssembly/WebAssembly/src/Prerendering/ClientComponentParameterDeserializer.cs
+++ b/src/Components/WebAssembly/WebAssembly/src/Prerendering/ClientComponentParameterDeserializer.cs
@@ -19,6 +19,7 @@ internal sealed class WebAssemblyComponentParameterDeserializer
public static WebAssemblyComponentParameterDeserializer Instance { get; } = new WebAssemblyComponentParameterDeserializer(new ComponentParametersTypeCache());
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "We expect application code is configured to preserve component parameter types.")]
public ParameterView DeserializeParameters(IList<ComponentParameter> parametersDefinitions, IList<object> parameterValues)
{
var parametersDictionary = new Dictionary<string, object?>(StringComparer.OrdinalIgnoreCase);
@@ -80,7 +81,7 @@ internal sealed class WebAssemblyComponentParameterDeserializer
return JsonSerializer.Deserialize<ComponentParameter[]>(parametersDefinitions, WebAssemblyComponentSerializationSettings.JsonSerializationOptions)!;
}
- [RequiresUnreferencedCode("This API attempts to JSON deserialize types which might be trimmed.")]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "We expect application code is configured to preserve component parameter types.")]
public static IList<object> GetParameterValues(string parameterValues)
{
return JsonSerializer.Deserialize<IList<object>>(parameterValues, WebAssemblyComponentSerializationSettings.JsonSerializationOptions)!;
diff --git a/src/DataProtection/DataProtection/src/Internal/HostingApplicationDiscriminator.cs b/src/DataProtection/DataProtection/src/Internal/HostingApplicationDiscriminator.cs
index 8d6a7f93c5..6b6944f1f3 100644
--- a/src/DataProtection/DataProtection/src/Internal/HostingApplicationDiscriminator.cs
+++ b/src/DataProtection/DataProtection/src/Internal/HostingApplicationDiscriminator.cs
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System;
using System.IO;
using Microsoft.AspNetCore.DataProtection.Infrastructure;
using Microsoft.Extensions.Hosting;
@@ -10,6 +11,8 @@ namespace Microsoft.AspNetCore.DataProtection.Internal;
internal sealed class HostingApplicationDiscriminator : IApplicationDiscriminator
{
private readonly IHostEnvironment? _hosting;
+ private readonly string DirectorySeparator = Path.DirectorySeparatorChar.ToString();
+ private readonly string AltDirectorySeparator = Path.AltDirectorySeparatorChar.ToString();
// the optional constructor for when IHostingEnvironment is not available from DI
public HostingApplicationDiscriminator()
@@ -21,6 +24,21 @@ internal sealed class HostingApplicationDiscriminator : IApplicationDiscriminato
_hosting = hosting;
}
- // Note: ContentRootPath behavior depends on the version, sometimes it has a trailing slash, we normalize by default by removing a trailing slash
- public string? Discriminator => _hosting?.ContentRootPath?.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
+ // Note: ContentRootPath behavior depends on the version, sometimes it does not have a trailing slash,
+ // we normalize by adding a trailing slash for non whitespace content root paths so data protection
+ // works across versions
+ public string? Discriminator
+ {
+ get
+ {
+ var contentRoot = _hosting?.ContentRootPath?.Trim();
+ if (string.IsNullOrEmpty(contentRoot) ||
+ contentRoot.EndsWith(DirectorySeparator, StringComparison.OrdinalIgnoreCase) ||
+ contentRoot.EndsWith(AltDirectorySeparator, StringComparison.OrdinalIgnoreCase))
+ {
+ return contentRoot;
+ }
+ return contentRoot + DirectorySeparator;
+ }
+ }
}
diff --git a/src/DataProtection/DataProtection/test/DataProtectionUtilityExtensionsTests.cs b/src/DataProtection/DataProtection/test/DataProtectionUtilityExtensionsTests.cs
index 7165949594..611cd5cbfd 100644
--- a/src/DataProtection/DataProtection/test/DataProtectionUtilityExtensionsTests.cs
+++ b/src/DataProtection/DataProtection/test/DataProtectionUtilityExtensionsTests.cs
@@ -4,18 +4,58 @@
using Microsoft.AspNetCore.DataProtection.Infrastructure;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
+using Microsoft.AspNetCore.Testing;
using Moq;
namespace Microsoft.AspNetCore.DataProtection;
public class DataProtectionUtilityExtensionsTests
{
- [Theory]
- [InlineData("app-path", "app-path")]
- [InlineData("app-path ", "app-path")] // normalized trim
+ [ConditionalTheory]
+ [InlineData("app-path", "app-path\\")]
+ [InlineData("app-path ", "app-path\\")] // normalized trim
+ [InlineData("app-path\\", "app-path\\")]
+ [InlineData("app-path \\", "app-path \\")]
+ [InlineData("app-path/", "app-path/")]
+ [InlineData("app-path /", "app-path /")]
+ [InlineData(" /", "/")]
+ [InlineData(" \\ ", "\\")]
+ [InlineData(" ", null)] // normalized whitespace -> null
+ [InlineData(null, null)] // nothing provided at all
+ [OSSkipCondition(OperatingSystems.Linux)]
+ [OSSkipCondition(OperatingSystems.MacOSX)]
+ public void GetApplicationUniqueIdentifierFromHostingWindows(string contentRootPath, string expected)
+ {
+ // Arrange
+ var mockEnvironment = new Mock<IHostEnvironment>();
+ mockEnvironment.Setup(o => o.ContentRootPath).Returns(contentRootPath);
+
+ var services = new ServiceCollection()
+ .AddSingleton(mockEnvironment.Object)
+ .AddDataProtection()
+ .Services
+ .BuildServiceProvider();
+
+ // Act
+ var actual = services.GetApplicationUniqueIdentifier();
+
+ // Assert
+ Assert.Equal(expected, actual);
+ }
+
+ [ConditionalTheory]
+ [InlineData("app-path", "app-path/")]
+ [InlineData("app-path ", "app-path/")] // normalized trim
+ [InlineData("app-path\\", "app-path\\/")]
+ [InlineData("app-path \\", "app-path \\/")]
+ [InlineData("app-path/", "app-path/")]
+ [InlineData("app-path /", "app-path /")]
+ [InlineData(" /", "/")]
+ [InlineData(" \\ ", "\\/")]
[InlineData(" ", null)] // normalized whitespace -> null
[InlineData(null, null)] // nothing provided at all
- public void GetApplicationUniqueIdentifierFromHosting(string contentRootPath, string expected)
+ [OSSkipCondition(OperatingSystems.Windows)]
+ public void GetApplicationUniqueIdentifierFromHostingNonWindows(string contentRootPath, string expected)
{
// Arrange
var mockEnvironment = new Mock<IHostEnvironment>();
diff --git a/src/DataProtection/DataProtection/test/HostingTests.cs b/src/DataProtection/DataProtection/test/HostingTests.cs
index 84c68bc0b7..b3a59177c6 100644
--- a/src/DataProtection/DataProtection/test/HostingTests.cs
+++ b/src/DataProtection/DataProtection/test/HostingTests.cs
@@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
using Microsoft.AspNetCore.Builder;
-using Microsoft.AspNetCore.DataProtection.Infrastructure;
using Microsoft.AspNetCore.DataProtection.KeyManagement.Internal;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Hosting.Server;
@@ -18,28 +17,6 @@ namespace Microsoft.AspNetCore.DataProtection.Test;
public class HostingTests
{
[Fact]
- public void DefaultApplicationDiscriminatorTrimsTrailingSlash()
- {
- var builder = new WebHostBuilder()
- .UseStartup<TestStartup>()
- .ConfigureServices(s => s.AddDataProtection());
-
- using (var host = builder.Build())
- {
- var contentRootPath = host.Services.GetRequiredService<IWebHostEnvironment>().ContentRootPath;
- Assert.True(contentRootPath.EndsWith(Path.DirectorySeparatorChar), "expected contentRootPath to end with a slash");
-
- var appDisc = host.Services.GetRequiredService<IApplicationDiscriminator>().Discriminator;
- Assert.False(appDisc.EndsWith(Path.DirectorySeparatorChar), "expected appDiscriminator to have slash trimmed");
- Assert.False(appDisc.EndsWith(Path.AltDirectorySeparatorChar), "expected appDiscriminator to have slash trimmed");
-
- var appId = host.Services.GetApplicationUniqueIdentifier();
- Assert.False(appId.EndsWith(Path.DirectorySeparatorChar), "expected appId to have slash trimmed");
- Assert.False(appId.EndsWith(Path.AltDirectorySeparatorChar), "expected appId to have slash trimmed");
- }
- }
-
- [Fact]
public async Task WebhostLoadsKeyRingBeforeServerStarts()
{
var tcs = new TaskCompletionSource();
diff --git a/src/Framework/AspNetCoreAnalyzers/test/Verifiers/CSharpRouteHandlerCodeFixVerifier.cs b/src/Framework/AspNetCoreAnalyzers/test/Verifiers/CSharpRouteHandlerCodeFixVerifier.cs
index dd81e98068..00f98f0d75 100644
--- a/src/Framework/AspNetCoreAnalyzers/test/Verifiers/CSharpRouteHandlerCodeFixVerifier.cs
+++ b/src/Framework/AspNetCoreAnalyzers/test/Verifiers/CSharpRouteHandlerCodeFixVerifier.cs
@@ -64,8 +64,8 @@ public static class CSharpRouteHandlerCodeFixVerifier<TAnalyzer, TCodeFix>
{
// We populate the ReferenceAssemblies used in the tests with the locally-built AspNetCore
// assemblies that are referenced in a minimal app to ensure that there are no reference
- // errors during the build.
- ReferenceAssemblies = ReferenceAssemblies.Net.Net60.AddAssemblies(ImmutableArray.Create(
+ // errors during the build. The value used here should be updated on each TFM change.
+ ReferenceAssemblies = ReferenceAssemblies.Net.Net70.AddAssemblies(ImmutableArray.Create(
TrimAssemblyExtension(typeof(Microsoft.AspNetCore.Builder.WebApplication).Assembly.Location),
TrimAssemblyExtension(typeof(Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions).Assembly.Location),
TrimAssemblyExtension(typeof(Microsoft.AspNetCore.Builder.IApplicationBuilder).Assembly.Location),
diff --git a/src/Framework/test/TestData.cs b/src/Framework/test/TestData.cs
index 6b3978eb4f..b36cb3fec2 100644
--- a/src/Framework/test/TestData.cs
+++ b/src/Framework/test/TestData.cs
@@ -75,6 +75,7 @@ public static class TestData
"Microsoft.AspNetCore.Mvc.ViewFeatures",
"Microsoft.AspNetCore.Razor",
"Microsoft.AspNetCore.Razor.Runtime",
+ "Microsoft.AspNetCore.RequestDecompression",
"Microsoft.AspNetCore.ResponseCaching",
"Microsoft.AspNetCore.ResponseCaching.Abstractions",
"Microsoft.AspNetCore.ResponseCompression",
@@ -210,6 +211,7 @@ public static class TestData
{ "Microsoft.AspNetCore.Mvc.ViewFeatures", "7.0.0.0" },
{ "Microsoft.AspNetCore.Razor", "7.0.0.0" },
{ "Microsoft.AspNetCore.Razor.Runtime", "7.0.0.0" },
+ { "Microsoft.AspNetCore.RequestDecompression", "7.0.0.0" },
{ "Microsoft.AspNetCore.ResponseCaching", "7.0.0.0" },
{ "Microsoft.AspNetCore.ResponseCaching.Abstractions", "7.0.0.0" },
{ "Microsoft.AspNetCore.ResponseCompression", "7.0.0.0" },
diff --git a/src/Hosting/Hosting/src/WebHostBuilder.cs b/src/Hosting/Hosting/src/WebHostBuilder.cs
index 2598ae6f08..c0db8b8734 100644
--- a/src/Hosting/Hosting/src/WebHostBuilder.cs
+++ b/src/Hosting/Hosting/src/WebHostBuilder.cs
@@ -310,6 +310,7 @@ public class WebHostBuilder : IWebHostBuilder
}
[UnconditionalSuppressMessage("Trimmer", "IL2077", Justification = "Finding startup type in assembly requires unreferenced code. Surfaced to user in UseStartup(startupAssemblyName).")]
+ [UnconditionalSuppressMessage("Trimmer", "IL2072", Justification = "Finding startup type in assembly requires unreferenced code. Surfaced to user in UseStartup(startupAssemblyName).")]
private void ScanAssemblyAndRegisterStartup(ServiceCollection services, string startupAssemblyName)
{
try
diff --git a/src/Http/Headers/src/HeaderNames.cs b/src/Http/Headers/src/HeaderNames.cs
index 1d7611d519..933331b1ad 100644
--- a/src/Http/Headers/src/HeaderNames.cs
+++ b/src/Http/Headers/src/HeaderNames.cs
@@ -189,6 +189,9 @@ public static class HeaderNames
/// <summary>Gets the <c>Pragma</c> HTTP header name.</summary>
public static readonly string Pragma = "Pragma";
+ /// <summary>Gets the <c>Protocol</c> HTTP header name.</summary>
+ public static readonly string Protocol = ":protocol";
+
/// <summary>Gets the <c>Proxy-Authenticate</c> HTTP header name.</summary>
public static readonly string ProxyAuthenticate = "Proxy-Authenticate";
diff --git a/src/Http/Headers/src/PublicAPI.Unshipped.txt b/src/Http/Headers/src/PublicAPI.Unshipped.txt
index 7dc5c58110..3341834df9 100644
--- a/src/Http/Headers/src/PublicAPI.Unshipped.txt
+++ b/src/Http/Headers/src/PublicAPI.Unshipped.txt
@@ -1 +1,2 @@
#nullable enable
+static readonly Microsoft.Net.Http.Headers.HeaderNames.Protocol -> string!
diff --git a/src/Http/Http.Abstractions/src/Metadata/IRequestSizeLimitMetadata.cs b/src/Http/Http.Abstractions/src/Metadata/IRequestSizeLimitMetadata.cs
new file mode 100644
index 0000000000..b90750ee63
--- /dev/null
+++ b/src/Http/Http.Abstractions/src/Metadata/IRequestSizeLimitMetadata.cs
@@ -0,0 +1,15 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace Microsoft.AspNetCore.Http.Metadata;
+
+/// <summary>
+/// Interface marking attributes that specify the maximum allowed size of the request body.
+/// </summary>
+public interface IRequestSizeLimitMetadata
+{
+ /// <summary>
+ /// The maximum allowed size of the current request body in bytes.
+ /// </summary>
+ long? MaxRequestBodySize { get; }
+}
diff --git a/src/Http/Http.Abstractions/src/PublicAPI.Unshipped.txt b/src/Http/Http.Abstractions/src/PublicAPI.Unshipped.txt
index ae9027335d..b8d0ab94d1 100644
--- a/src/Http/Http.Abstractions/src/PublicAPI.Unshipped.txt
+++ b/src/Http/Http.Abstractions/src/PublicAPI.Unshipped.txt
@@ -12,10 +12,13 @@ Microsoft.AspNetCore.Http.EndpointMetadataCollection.GetRequiredMetadata<T>() ->
Microsoft.AspNetCore.Http.IRouteHandlerFilter.InvokeAsync(Microsoft.AspNetCore.Http.RouteHandlerInvocationContext! context, Microsoft.AspNetCore.Http.RouteHandlerFilterDelegate! next) -> System.Threading.Tasks.ValueTask<object?>
Microsoft.AspNetCore.Http.Metadata.IFromFormMetadata
Microsoft.AspNetCore.Http.Metadata.IFromFormMetadata.Name.get -> string?
+Microsoft.AspNetCore.Http.Metadata.IRequestSizeLimitMetadata
+Microsoft.AspNetCore.Http.Metadata.IRequestSizeLimitMetadata.MaxRequestBodySize.get -> long?
Microsoft.AspNetCore.Http.RouteHandlerContext
+Microsoft.AspNetCore.Http.RouteHandlerContext.ApplicationServices.get -> System.IServiceProvider!
Microsoft.AspNetCore.Http.RouteHandlerContext.EndpointMetadata.get -> Microsoft.AspNetCore.Http.EndpointMetadataCollection!
Microsoft.AspNetCore.Http.RouteHandlerContext.MethodInfo.get -> System.Reflection.MethodInfo!
-Microsoft.AspNetCore.Http.RouteHandlerContext.RouteHandlerContext(System.Reflection.MethodInfo! methodInfo, Microsoft.AspNetCore.Http.EndpointMetadataCollection! endpointMetadata) -> void
+Microsoft.AspNetCore.Http.RouteHandlerContext.RouteHandlerContext(System.Reflection.MethodInfo! methodInfo, Microsoft.AspNetCore.Http.EndpointMetadataCollection! endpointMetadata, System.IServiceProvider! applicationServices) -> void
Microsoft.AspNetCore.Http.RouteHandlerFilterDelegate
Microsoft.AspNetCore.Http.RouteHandlerInvocationContext
Microsoft.AspNetCore.Http.RouteHandlerInvocationContext.RouteHandlerInvocationContext() -> void
diff --git a/src/Http/Http.Abstractions/src/RouteHandlerContext.cs b/src/Http/Http.Abstractions/src/RouteHandlerContext.cs
index fdf54a3b9b..93c398f1e4 100644
--- a/src/Http/Http.Abstractions/src/RouteHandlerContext.cs
+++ b/src/Http/Http.Abstractions/src/RouteHandlerContext.cs
@@ -16,10 +16,16 @@ public sealed class RouteHandlerContext
/// </summary>
/// <param name="methodInfo">The <see cref="MethodInfo"/> associated with the route handler of the current request.</param>
/// <param name="endpointMetadata">The <see cref="EndpointMetadataCollection"/> associated with the endpoint the filter is targeting.</param>
- public RouteHandlerContext(MethodInfo methodInfo, EndpointMetadataCollection endpointMetadata)
+ /// <param name="applicationServices">The <see cref="IServiceProvider"/> instance used to access the application services.</param>
+ public RouteHandlerContext(MethodInfo methodInfo, EndpointMetadataCollection endpointMetadata, IServiceProvider applicationServices)
{
+ ArgumentNullException.ThrowIfNull(methodInfo);
+ ArgumentNullException.ThrowIfNull(endpointMetadata);
+ ArgumentNullException.ThrowIfNull(applicationServices);
+
MethodInfo = methodInfo;
EndpointMetadata = endpointMetadata;
+ ApplicationServices = applicationServices;
}
/// <summary>
@@ -31,4 +37,9 @@ public sealed class RouteHandlerContext
/// The <see cref="EndpointMetadataCollection"/> associated with the current endpoint.
/// </summary>
public EndpointMetadataCollection EndpointMetadata { get; }
+
+ /// <summary>
+ /// Gets the <see cref="IServiceProvider"/> instance used to access application services.
+ /// </summary>
+ public IServiceProvider ApplicationServices { get; }
}
diff --git a/src/Http/Http.Extensions/src/EndpointMetadataContext.cs b/src/Http/Http.Extensions/src/EndpointMetadataContext.cs
index 7f8d2c20b6..caf9645568 100644
--- a/src/Http/Http.Extensions/src/EndpointMetadataContext.cs
+++ b/src/Http/Http.Extensions/src/EndpointMetadataContext.cs
@@ -15,15 +15,16 @@ public sealed class EndpointMetadataContext
/// </summary>
/// <param name="method">The <see cref="MethodInfo"/> of the route handler delegate of the endpoint being created.</param>
/// <param name="endpointMetadata">The list of objects that will be added to the metadata of the endpoint.</param>
- /// <param name="services">The <see cref="IServiceProvider"/> instance used to access application services.</param>
- public EndpointMetadataContext(MethodInfo method, IList<object> endpointMetadata, IServiceProvider? services)
+ /// <param name="applicationServices">The <see cref="IServiceProvider"/> instance used to access application services.</param>
+ public EndpointMetadataContext(MethodInfo method, IList<object> endpointMetadata, IServiceProvider applicationServices)
{
- ArgumentNullException.ThrowIfNull(method, nameof(method));
- ArgumentNullException.ThrowIfNull(endpointMetadata, nameof(endpointMetadata));
+ ArgumentNullException.ThrowIfNull(method);
+ ArgumentNullException.ThrowIfNull(endpointMetadata);
+ ArgumentNullException.ThrowIfNull(applicationServices);
Method = method;
EndpointMetadata = endpointMetadata;
- Services = services;
+ ApplicationServices = applicationServices;
}
/// <summary>
@@ -39,5 +40,5 @@ public sealed class EndpointMetadataContext
/// <summary>
/// Gets the <see cref="IServiceProvider"/> instance used to access application services.
/// </summary>
- public IServiceProvider? Services { get; }
+ public IServiceProvider ApplicationServices { get; }
}
diff --git a/src/Http/Http.Extensions/src/EndpointParameterMetadataContext.cs b/src/Http/Http.Extensions/src/EndpointParameterMetadataContext.cs
index e307ae2d14..202839cc80 100644
--- a/src/Http/Http.Extensions/src/EndpointParameterMetadataContext.cs
+++ b/src/Http/Http.Extensions/src/EndpointParameterMetadataContext.cs
@@ -15,15 +15,16 @@ public sealed class EndpointParameterMetadataContext
/// </summary>
/// <param name="parameter">The parameter of the route handler delegate of the endpoint being created.</param>
/// <param name="endpointMetadata">The list of objects that will be added to the metadata of the endpoint.</param>
- /// <param name="services">The <see cref="IServiceProvider"/> instance used to access application services.</param>
- public EndpointParameterMetadataContext(ParameterInfo parameter, IList<object> endpointMetadata, IServiceProvider? services)
+ /// <param name="applicationServices">The <see cref="IServiceProvider"/> instance used to access application services.</param>
+ public EndpointParameterMetadataContext(ParameterInfo parameter, IList<object> endpointMetadata, IServiceProvider applicationServices)
{
- ArgumentNullException.ThrowIfNull(parameter, nameof(parameter));
- ArgumentNullException.ThrowIfNull(endpointMetadata, nameof(endpointMetadata));
+ ArgumentNullException.ThrowIfNull(parameter);
+ ArgumentNullException.ThrowIfNull(endpointMetadata);
+ ArgumentNullException.ThrowIfNull(applicationServices);
Parameter = parameter;
EndpointMetadata = endpointMetadata;
- Services = services;
+ ApplicationServices = applicationServices;
}
/// <summary>
@@ -39,5 +40,5 @@ public sealed class EndpointParameterMetadataContext
/// <summary>
/// Gets the <see cref="IServiceProvider"/> instance used to access application services.
/// </summary>
- public IServiceProvider? Services { get; }
+ public IServiceProvider ApplicationServices { get; }
}
diff --git a/src/Http/Http.Extensions/src/PublicAPI.Unshipped.txt b/src/Http/Http.Extensions/src/PublicAPI.Unshipped.txt
index 93e10e87b5..f2913822e1 100644
--- a/src/Http/Http.Extensions/src/PublicAPI.Unshipped.txt
+++ b/src/Http/Http.Extensions/src/PublicAPI.Unshipped.txt
@@ -1,14 +1,14 @@
#nullable enable
Microsoft.AspNetCore.Http.Metadata.EndpointMetadataContext
-Microsoft.AspNetCore.Http.Metadata.EndpointMetadataContext.EndpointMetadataContext(System.Reflection.MethodInfo! method, System.Collections.Generic.IList<object!>! endpointMetadata, System.IServiceProvider? services) -> void
+Microsoft.AspNetCore.Http.Metadata.EndpointMetadataContext.ApplicationServices.get -> System.IServiceProvider!
+Microsoft.AspNetCore.Http.Metadata.EndpointMetadataContext.EndpointMetadataContext(System.Reflection.MethodInfo! method, System.Collections.Generic.IList<object!>! endpointMetadata, System.IServiceProvider! applicationServices) -> void
Microsoft.AspNetCore.Http.Metadata.EndpointMetadataContext.EndpointMetadata.get -> System.Collections.Generic.IList<object!>!
Microsoft.AspNetCore.Http.Metadata.EndpointMetadataContext.Method.get -> System.Reflection.MethodInfo!
-Microsoft.AspNetCore.Http.Metadata.EndpointMetadataContext.Services.get -> System.IServiceProvider?
Microsoft.AspNetCore.Http.Metadata.EndpointParameterMetadataContext
-Microsoft.AspNetCore.Http.Metadata.EndpointParameterMetadataContext.EndpointParameterMetadataContext(System.Reflection.ParameterInfo! parameter, System.Collections.Generic.IList<object!>! endpointMetadata, System.IServiceProvider? services) -> void
+Microsoft.AspNetCore.Http.Metadata.EndpointParameterMetadataContext.ApplicationServices.get -> System.IServiceProvider!
+Microsoft.AspNetCore.Http.Metadata.EndpointParameterMetadataContext.EndpointParameterMetadataContext(System.Reflection.ParameterInfo! parameter, System.Collections.Generic.IList<object!>! endpointMetadata, System.IServiceProvider! applicationServices) -> void
Microsoft.AspNetCore.Http.Metadata.EndpointParameterMetadataContext.EndpointMetadata.get -> System.Collections.Generic.IList<object!>!
Microsoft.AspNetCore.Http.Metadata.EndpointParameterMetadataContext.Parameter.get -> System.Reflection.ParameterInfo!
-Microsoft.AspNetCore.Http.Metadata.EndpointParameterMetadataContext.Services.get -> System.IServiceProvider?
Microsoft.AspNetCore.Http.Metadata.IEndpointMetadataProvider
Microsoft.AspNetCore.Http.Metadata.IEndpointMetadataProvider.PopulateMetadata(Microsoft.AspNetCore.Http.Metadata.EndpointMetadataContext! context) -> void
Microsoft.AspNetCore.Http.Metadata.IEndpointParameterMetadataProvider
diff --git a/src/Http/Http.Extensions/src/RequestDelegateFactory.cs b/src/Http/Http.Extensions/src/RequestDelegateFactory.cs
index 9e1c60a2a7..265351805e 100644
--- a/src/Http/Http.Extensions/src/RequestDelegateFactory.cs
+++ b/src/Http/Http.Extensions/src/RequestDelegateFactory.cs
@@ -305,7 +305,8 @@ public static partial class RequestDelegateFactory
FilterContextExpr).Compile();
var routeHandlerContext = new RouteHandlerContext(
methodInfo,
- new EndpointMetadataCollection(factoryContext.Metadata));
+ new EndpointMetadataCollection(factoryContext.Metadata),
+ factoryContext.ServiceProvider ?? EmptyServiceProvider.Instance);
for (var i = factoryContext.Filters.Count - 1; i >= 0; i--)
{
@@ -442,7 +443,7 @@ public static partial class RequestDelegateFactory
if (typeof(IEndpointParameterMetadataProvider).IsAssignableFrom(parameter.ParameterType))
{
// Parameter type implements IEndpointParameterMetadataProvider
- var parameterContext = new EndpointParameterMetadataContext(parameter, metadata, services);
+ var parameterContext = new EndpointParameterMetadataContext(parameter, metadata, services ?? EmptyServiceProvider.Instance);
invokeArgs ??= new object[1];
invokeArgs[0] = parameterContext;
PopulateMetadataForParameterMethod.MakeGenericMethod(parameter.ParameterType).Invoke(null, invokeArgs);
@@ -451,7 +452,7 @@ public static partial class RequestDelegateFactory
if (typeof(IEndpointMetadataProvider).IsAssignableFrom(parameter.ParameterType))
{
// Parameter type implements IEndpointMetadataProvider
- var context = new EndpointMetadataContext(methodInfo, metadata, services);
+ var context = new EndpointMetadataContext(methodInfo, metadata, services ?? EmptyServiceProvider.Instance);
invokeArgs ??= new object[1];
invokeArgs[0] = context;
PopulateMetadataForEndpointMethod.MakeGenericMethod(parameter.ParameterType).Invoke(null, invokeArgs);
@@ -468,7 +469,7 @@ public static partial class RequestDelegateFactory
if (returnType is not null && typeof(IEndpointMetadataProvider).IsAssignableFrom(returnType))
{
// Return type implements IEndpointMetadataProvider
- var context = new EndpointMetadataContext(methodInfo, metadata, services);
+ var context = new EndpointMetadataContext(methodInfo, metadata, services ?? EmptyServiceProvider.Instance);
invokeArgs ??= new object[1];
invokeArgs[0] = context;
PopulateMetadataForEndpointMethod.MakeGenericMethod(returnType).Invoke(null, invokeArgs);
@@ -2350,4 +2351,11 @@ public static partial class RequestDelegateFactory
return Task.CompletedTask;
}
}
+
+ private sealed class EmptyServiceProvider : IServiceProvider
+ {
+ public static IServiceProvider Instance { get; } = new EmptyServiceProvider();
+
+ public object? GetService(Type serviceType) => null;
+ }
}
diff --git a/src/Http/Http.Extensions/test/EndpointMetadataContextTests.cs b/src/Http/Http.Extensions/test/EndpointMetadataContextTests.cs
index c71b931e73..3fa0a9a143 100644
--- a/src/Http/Http.Extensions/test/EndpointMetadataContextTests.cs
+++ b/src/Http/Http.Extensions/test/EndpointMetadataContextTests.cs
@@ -16,7 +16,7 @@ public class EndpointMetadataContextTests
[Fact]
public void EndpointMetadataContext_Ctor_ThrowsArgumentNullException_WhenMethodInfoIsNull()
{
- Assert.Throws<ArgumentNullException>(() => new EndpointMetadataContext(null, new List<object>(), null));
+ Assert.Throws<ArgumentNullException>("method", () => new EndpointMetadataContext(null, new List<object>(), null));
}
[Fact]
@@ -25,13 +25,22 @@ public class EndpointMetadataContextTests
Delegate handler = (int id) => { };
var method = handler.GetMethodInfo();
- Assert.Throws<ArgumentNullException>(() => new EndpointMetadataContext(method, null, null));
+ Assert.Throws<ArgumentNullException>("endpointMetadata", () => new EndpointMetadataContext(method, null, null));
+ }
+
+ [Fact]
+ public void EndpointMetadataContext_Ctor_ThrowsArgumentNullException_WhenApplicationServicesAreNull()
+ {
+ Delegate handler = (int id) => { };
+ var method = handler.GetMethodInfo();
+
+ Assert.Throws<ArgumentNullException>("applicationServices", () => new EndpointMetadataContext(method, new List<object>(), null));
}
[Fact]
public void EndpointParameterMetadataContext_Ctor_ThrowsArgumentNullException_WhenParameterInfoIsNull()
{
- Assert.Throws<ArgumentNullException>(() => new EndpointParameterMetadataContext(null, new List<object>(), null));
+ Assert.Throws<ArgumentNullException>("parameter", () => new EndpointParameterMetadataContext(null, new List<object>(), null));
}
[Fact]
@@ -40,6 +49,15 @@ public class EndpointMetadataContextTests
Delegate handler = (int id) => { };
var parameter = handler.GetMethodInfo().GetParameters()[0];
- Assert.Throws<ArgumentNullException>(() => new EndpointParameterMetadataContext(parameter, null, null));
+ Assert.Throws<ArgumentNullException>("endpointMetadata", () => new EndpointParameterMetadataContext(parameter, null, null));
+ }
+
+ [Fact]
+ public void EndpointParameterMetadataContext_Ctor_ThrowsArgumentNullException_WhenApplicationServicesAreNull()
+ {
+ Delegate handler = (int id) => { };
+ var parameter = handler.GetMethodInfo().GetParameters()[0];
+
+ Assert.Throws<ArgumentNullException>("applicationServices", () => new EndpointParameterMetadataContext(parameter, new List<object>(), null));
}
}
diff --git a/src/Http/Http.Extensions/test/RequestDelegateFactoryTests.cs b/src/Http/Http.Extensions/test/RequestDelegateFactoryTests.cs
index 19aed0340a..445e3c2adb 100644
--- a/src/Http/Http.Extensions/test/RequestDelegateFactoryTests.cs
+++ b/src/Http/Http.Extensions/test/RequestDelegateFactoryTests.cs
@@ -6025,6 +6025,36 @@ public class RequestDelegateFactoryTests : LoggedTest
Assert.DoesNotContain(result.EndpointMetadata, m => m is IAcceptsMetadata);
}
+ [Fact]
+ public void Create_SetsApplicationServices_OnEndpointMetadataContext()
+ {
+ // Arrange
+ var @delegate = (Todo todo) => new AccessesServicesMetadataResult();
+ var metadataService = new MetadataService();
+ var serviceProvider = new ServiceCollection().AddSingleton(metadataService).BuildServiceProvider();
+
+ // Act
+ var result = RequestDelegateFactory.Create(@delegate, new() { ServiceProvider = serviceProvider });
+
+ // Assert
+ Assert.Contains(result.EndpointMetadata, m => m is MetadataService);
+ }
+
+ [Fact]
+ public void Create_SetsApplicationServices_OnEndpointParameterMetadataContext()
+ {
+ // Arrange
+ var @delegate = (AccessesServicesMetadataBinder parameter1) => "Test";
+ var metadataService = new MetadataService();
+ var serviceProvider = new ServiceCollection().AddSingleton(metadataService).BuildServiceProvider();
+
+ // Act
+ var result = RequestDelegateFactory.Create(@delegate, new() { ServiceProvider = serviceProvider });
+
+ // Assert
+ Assert.Contains(result.EndpointMetadata, m => m is MetadataService);
+ }
+
private DefaultHttpContext CreateHttpContext()
{
var responseFeature = new TestHttpResponseFeature();
@@ -6041,6 +6071,35 @@ public class RequestDelegateFactoryTests : LoggedTest
};
}
+ private record MetadataService;
+
+ private class AccessesServicesMetadataResult : IResult, IEndpointMetadataProvider
+ {
+ public static void PopulateMetadata(EndpointMetadataContext context)
+ {
+ if (context.ApplicationServices?.GetRequiredService<MetadataService>() is { } metadataService)
+ {
+ context.EndpointMetadata.Add(metadataService);
+ }
+ }
+
+ public Task ExecuteAsync(HttpContext httpContext) => Task.CompletedTask;
+ }
+
+ private class AccessesServicesMetadataBinder : IEndpointMetadataProvider
+ {
+ public static ValueTask<AccessesServicesMetadataBinder> BindAsync(HttpContext context, ParameterInfo parameter) =>
+ new(new AccessesServicesMetadataBinder());
+
+ public static void PopulateMetadata(EndpointMetadataContext context)
+ {
+ if (context.ApplicationServices?.GetRequiredService<MetadataService>() is { } metadataService)
+ {
+ context.EndpointMetadata.Add(metadataService);
+ }
+ }
+ }
+
private class Attribute1 : Attribute
{
}
diff --git a/src/Http/Http.Results/test/AcceptedAtRouteOfTResultTests.cs b/src/Http/Http.Results/test/AcceptedAtRouteOfTResultTests.cs
index bd03a6e3f2..56be797a07 100644
--- a/src/Http/Http.Results/test/AcceptedAtRouteOfTResultTests.cs
+++ b/src/Http/Http.Results/test/AcceptedAtRouteOfTResultTests.cs
@@ -122,7 +122,7 @@ public class AcceptedAtRouteOfTResultTests
// Arrange
AcceptedAtRoute<Todo> MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<AcceptedAtRoute<Todo>>(context);
diff --git a/src/Http/Http.Results/test/AcceptedAtRouteResultTests.cs b/src/Http/Http.Results/test/AcceptedAtRouteResultTests.cs
index c8d663b525..4e25a19ec6 100644
--- a/src/Http/Http.Results/test/AcceptedAtRouteResultTests.cs
+++ b/src/Http/Http.Results/test/AcceptedAtRouteResultTests.cs
@@ -75,7 +75,7 @@ public class AcceptedAtRouteResultTests
// Arrange
AcceptedAtRoute MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<AcceptedAtRoute>(context);
diff --git a/src/Http/Http.Results/test/AcceptedOfTResultTests.cs b/src/Http/Http.Results/test/AcceptedOfTResultTests.cs
index 4a9193ed1e..868fb5f502 100644
--- a/src/Http/Http.Results/test/AcceptedOfTResultTests.cs
+++ b/src/Http/Http.Results/test/AcceptedOfTResultTests.cs
@@ -62,7 +62,7 @@ public class AcceptedOfTResultTests
// Arrange
Accepted<Todo> MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<Accepted<Todo>>(context);
diff --git a/src/Http/Http.Results/test/AcceptedResultTests.cs b/src/Http/Http.Results/test/AcceptedResultTests.cs
index 4c762562a6..7bbfa4fd6c 100644
--- a/src/Http/Http.Results/test/AcceptedResultTests.cs
+++ b/src/Http/Http.Results/test/AcceptedResultTests.cs
@@ -32,7 +32,7 @@ public class AcceptedResultTests
// Arrange
Accepted MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<Accepted>(context);
diff --git a/src/Http/Http.Results/test/BadRequestOfTResultTests.cs b/src/Http/Http.Results/test/BadRequestOfTResultTests.cs
index f5ad69cfdc..8fe74712b3 100644
--- a/src/Http/Http.Results/test/BadRequestOfTResultTests.cs
+++ b/src/Http/Http.Results/test/BadRequestOfTResultTests.cs
@@ -104,7 +104,7 @@ public class BadRequestOfTResultTests
// Arrange
BadRequest<Todo> MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<BadRequest<Todo>>(context);
diff --git a/src/Http/Http.Results/test/BadRequestResultTests.cs b/src/Http/Http.Results/test/BadRequestResultTests.cs
index 587e503b38..125e07dbc4 100644
--- a/src/Http/Http.Results/test/BadRequestResultTests.cs
+++ b/src/Http/Http.Results/test/BadRequestResultTests.cs
@@ -45,7 +45,7 @@ public class BadRequestResultTests
// Arrange
BadRequest MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<BadRequest>(context);
diff --git a/src/Http/Http.Results/test/ConflictOfTResultTests.cs b/src/Http/Http.Results/test/ConflictOfTResultTests.cs
index 8d54e526fe..c69bafdfbd 100644
--- a/src/Http/Http.Results/test/ConflictOfTResultTests.cs
+++ b/src/Http/Http.Results/test/ConflictOfTResultTests.cs
@@ -83,7 +83,7 @@ public class ConflictOfTResultTests
// Arrange
Conflict<Todo> MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<Conflict<Todo>>(context);
diff --git a/src/Http/Http.Results/test/ConflictResultTests.cs b/src/Http/Http.Results/test/ConflictResultTests.cs
index e709d7a9f8..391e248f09 100644
--- a/src/Http/Http.Results/test/ConflictResultTests.cs
+++ b/src/Http/Http.Results/test/ConflictResultTests.cs
@@ -46,7 +46,7 @@ public class ConflictResultTests
// Arrange
Conflict MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<Conflict>(context);
diff --git a/src/Http/Http.Results/test/CreatedAtRouteOfTResultTests.cs b/src/Http/Http.Results/test/CreatedAtRouteOfTResultTests.cs
index 9579f00e04..8bbe69d1f0 100644
--- a/src/Http/Http.Results/test/CreatedAtRouteOfTResultTests.cs
+++ b/src/Http/Http.Results/test/CreatedAtRouteOfTResultTests.cs
@@ -89,7 +89,7 @@ public partial class CreatedAtRouteOfTResultTests
// Arrange
CreatedAtRoute<Todo> MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<CreatedAtRoute<Todo>>(context);
diff --git a/src/Http/Http.Results/test/CreatedAtRouteResultTests.cs b/src/Http/Http.Results/test/CreatedAtRouteResultTests.cs
index 04c55274d6..eee33d4d84 100644
--- a/src/Http/Http.Results/test/CreatedAtRouteResultTests.cs
+++ b/src/Http/Http.Results/test/CreatedAtRouteResultTests.cs
@@ -71,7 +71,7 @@ public partial class CreatedAtRouteResultTests
// Arrange
CreatedAtRoute MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<CreatedAtRoute>(context);
diff --git a/src/Http/Http.Results/test/CreatedOfTResultTests.cs b/src/Http/Http.Results/test/CreatedOfTResultTests.cs
index 272022a88e..9200d550ee 100644
--- a/src/Http/Http.Results/test/CreatedOfTResultTests.cs
+++ b/src/Http/Http.Results/test/CreatedOfTResultTests.cs
@@ -97,7 +97,7 @@ public class CreatedOfTResultTests
// Arrange
Created<Todo> MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<Created<Todo>>(context);
diff --git a/src/Http/Http.Results/test/CreatedResultTests.cs b/src/Http/Http.Results/test/CreatedResultTests.cs
index e4ca455e14..82f4a88b23 100644
--- a/src/Http/Http.Results/test/CreatedResultTests.cs
+++ b/src/Http/Http.Results/test/CreatedResultTests.cs
@@ -63,7 +63,7 @@ public class CreatedResultTests
// Arrange
Created MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<Created>(context);
diff --git a/src/Http/Http.Results/test/EmptyServiceProvider.cs b/src/Http/Http.Results/test/EmptyServiceProvider.cs
new file mode 100644
index 0000000000..1960ce9401
--- /dev/null
+++ b/src/Http/Http.Results/test/EmptyServiceProvider.cs
@@ -0,0 +1,11 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace Microsoft.AspNetCore.Http.HttpResults;
+
+internal sealed class EmptyServiceProvider : IServiceProvider
+{
+ public static IServiceProvider Instance { get; } = new EmptyServiceProvider();
+
+ public object GetService(Type serviceType) => null;
+}
diff --git a/src/Http/Http.Results/test/NoContentResultTests.cs b/src/Http/Http.Results/test/NoContentResultTests.cs
index 17435be509..927670466b 100644
--- a/src/Http/Http.Results/test/NoContentResultTests.cs
+++ b/src/Http/Http.Results/test/NoContentResultTests.cs
@@ -42,7 +42,7 @@ public class NoContentResultTests
// Arrange
NoContent MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<NoContent>(context);
diff --git a/src/Http/Http.Results/test/NotFoundOfTResultTests.cs b/src/Http/Http.Results/test/NotFoundOfTResultTests.cs
index 959c09340c..72a922fa0a 100644
--- a/src/Http/Http.Results/test/NotFoundOfTResultTests.cs
+++ b/src/Http/Http.Results/test/NotFoundOfTResultTests.cs
@@ -65,7 +65,7 @@ public class NotFoundOfTResultTests
// Arrange
NotFound<Todo> MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<NotFound<Todo>>(context);
diff --git a/src/Http/Http.Results/test/NotFoundResultTests.cs b/src/Http/Http.Results/test/NotFoundResultTests.cs
index 0e7a2cb70c..6b243d61c5 100644
--- a/src/Http/Http.Results/test/NotFoundResultTests.cs
+++ b/src/Http/Http.Results/test/NotFoundResultTests.cs
@@ -41,7 +41,7 @@ public class NotFoundResultTests
// Arrange
NotFound MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<NotFound>(context);
diff --git a/src/Http/Http.Results/test/OkOfTResultTests.cs b/src/Http/Http.Results/test/OkOfTResultTests.cs
index bd4d11e1eb..7dd8f98011 100644
--- a/src/Http/Http.Results/test/OkOfTResultTests.cs
+++ b/src/Http/Http.Results/test/OkOfTResultTests.cs
@@ -82,7 +82,7 @@ public class OkOfTResultTests
// Arrange
Ok<Todo> MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<Ok<Todo>>(context);
diff --git a/src/Http/Http.Results/test/OkResultTests.cs b/src/Http/Http.Results/test/OkResultTests.cs
index da480961e6..f99a403da2 100644
--- a/src/Http/Http.Results/test/OkResultTests.cs
+++ b/src/Http/Http.Results/test/OkResultTests.cs
@@ -45,7 +45,7 @@ public class OkResultTests
// Arrange
Ok MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<Ok>(context);
diff --git a/src/Http/Http.Results/test/ResultsOfTTests.Generated.cs b/src/Http/Http.Results/test/ResultsOfTTests.Generated.cs
index 2588a2e275..618fe5fed1 100644
--- a/src/Http/Http.Results/test/ResultsOfTTests.Generated.cs
+++ b/src/Http/Http.Results/test/ResultsOfTTests.Generated.cs
@@ -208,7 +208,7 @@ public partial class ResultsOfTTests
// Arrange
Results<ProvidesMetadataResult1, ProvidesMetadataResult2> MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<Results<ProvidesMetadataResult1, ProvidesMetadataResult2>>(context);
@@ -487,7 +487,7 @@ public partial class ResultsOfTTests
// Arrange
Results<ProvidesMetadataResult1, ProvidesMetadataResult2, ProvidesMetadataResult3> MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<Results<ProvidesMetadataResult1, ProvidesMetadataResult2, ProvidesMetadataResult3>>(context);
@@ -843,7 +843,7 @@ public partial class ResultsOfTTests
// Arrange
Results<ProvidesMetadataResult1, ProvidesMetadataResult2, ProvidesMetadataResult3, ProvidesMetadataResult4> MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<Results<ProvidesMetadataResult1, ProvidesMetadataResult2, ProvidesMetadataResult3, ProvidesMetadataResult4>>(context);
@@ -1284,7 +1284,7 @@ public partial class ResultsOfTTests
// Arrange
Results<ProvidesMetadataResult1, ProvidesMetadataResult2, ProvidesMetadataResult3, ProvidesMetadataResult4, ProvidesMetadataResult5> MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<Results<ProvidesMetadataResult1, ProvidesMetadataResult2, ProvidesMetadataResult3, ProvidesMetadataResult4, ProvidesMetadataResult5>>(context);
@@ -1818,7 +1818,7 @@ public partial class ResultsOfTTests
// Arrange
Results<ProvidesMetadataResult1, ProvidesMetadataResult2, ProvidesMetadataResult3, ProvidesMetadataResult4, ProvidesMetadataResult5, ProvidesMetadataResult6> MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<Results<ProvidesMetadataResult1, ProvidesMetadataResult2, ProvidesMetadataResult3, ProvidesMetadataResult4, ProvidesMetadataResult5, ProvidesMetadataResult6>>(context);
diff --git a/src/Http/Http.Results/test/ResultsOfTTests.cs b/src/Http/Http.Results/test/ResultsOfTTests.cs
index 1fcca5437c..b68cd6eca9 100644
--- a/src/Http/Http.Results/test/ResultsOfTTests.cs
+++ b/src/Http/Http.Results/test/ResultsOfTTests.cs
@@ -94,4 +94,11 @@ public partial class ResultsOfTTests
{
public string SourceTypeName { get; init; }
}
+
+ private class EmptyServiceProvider : IServiceProvider
+ {
+ public static IServiceProvider Instance { get; } = new EmptyServiceProvider();
+
+ public object GetService(Type serviceType) => null;
+ }
}
diff --git a/src/Http/Http.Results/test/UnprocessableEntityOfTResultTests.cs b/src/Http/Http.Results/test/UnprocessableEntityOfTResultTests.cs
index 9a2349a21f..fdf35f66f6 100644
--- a/src/Http/Http.Results/test/UnprocessableEntityOfTResultTests.cs
+++ b/src/Http/Http.Results/test/UnprocessableEntityOfTResultTests.cs
@@ -82,7 +82,7 @@ public class UnprocessableEntityOfTResultTests
// Arrange
UnprocessableEntity<Todo> MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<UnprocessableEntity<Todo>>(context);
diff --git a/src/Http/Http.Results/test/UnprocessableEntityResultTests.cs b/src/Http/Http.Results/test/UnprocessableEntityResultTests.cs
index 1f1592fdaa..8e03d19fe0 100644
--- a/src/Http/Http.Results/test/UnprocessableEntityResultTests.cs
+++ b/src/Http/Http.Results/test/UnprocessableEntityResultTests.cs
@@ -45,7 +45,7 @@ public class UnprocessableEntityResultTests
// Arrange
UnprocessableEntity MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<UnprocessableEntity>(context);
diff --git a/src/Http/Http.Results/test/ValidationProblemResultTests.cs b/src/Http/Http.Results/test/ValidationProblemResultTests.cs
index 40c01b4419..adfeba25c8 100644
--- a/src/Http/Http.Results/test/ValidationProblemResultTests.cs
+++ b/src/Http/Http.Results/test/ValidationProblemResultTests.cs
@@ -62,7 +62,7 @@ public class ValidationProblemResultTests
// Arrange
ValidationProblem MyApi() { throw new NotImplementedException(); }
var metadata = new List<object>();
- var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// Act
PopulateMetadata<ValidationProblem>(context);
diff --git a/src/Http/Http.Results/tools/ResultsOfTGenerator/Program.cs b/src/Http/Http.Results/tools/ResultsOfTGenerator/Program.cs
index d1e0b76851..c1159c27a3 100644
--- a/src/Http/Http.Results/tools/ResultsOfTGenerator/Program.cs
+++ b/src/Http/Http.Results/tools/ResultsOfTGenerator/Program.cs
@@ -814,7 +814,7 @@ public class Program
// // Arrange
// Results<ProvidesMetadataResult1, ProvidesMetadataResult2> MyApi() { throw new NotImplementedException(); }
// var metadata = new List<object>();
- // var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);
+ // var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);
// // Act
// PopulateMetadata<Results<ProvidesMetadataResult1, ProvidesMetadataResult2>>(context);
@@ -850,7 +850,7 @@ public class Program
}
writer.WriteLine("> MyApi() { throw new NotImplementedException(); }");
writer.WriteIndentedLine(2, "var metadata = new List<object>();");
- writer.WriteIndentedLine(2, "var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, null);");
+ writer.WriteIndentedLine(2, "var context = new EndpointMetadataContext(((Delegate)MyApi).GetMethodInfo(), metadata, EmptyServiceProvider.Instance);");
writer.WriteLine();
// Act
diff --git a/src/Http/Routing/src/Builder/OpenApiRouteHandlerBuilderExtensions.cs b/src/Http/Routing/src/Builder/OpenApiRouteHandlerBuilderExtensions.cs
index 2456ed622c..2615e70e1a 100644
--- a/src/Http/Routing/src/Builder/OpenApiRouteHandlerBuilderExtensions.cs
+++ b/src/Http/Routing/src/Builder/OpenApiRouteHandlerBuilderExtensions.cs
@@ -20,14 +20,19 @@ public static class OpenApiRouteHandlerBuilderExtensions
/// Adds the <see cref="IExcludeFromDescriptionMetadata"/> to <see cref="EndpointBuilder.Metadata"/> for all endpoints
/// produced by <paramref name="builder"/>.
/// </summary>
+ /// <param name="builder">The <see cref="IEndpointConventionBuilder"/>.</param>
+ /// <returns>A <see cref="IEndpointConventionBuilder"/> that can be used to further customize the endpoint.</returns>
+ public static TBuilder ExcludeFromDescription<TBuilder>(this TBuilder builder) where TBuilder : IEndpointConventionBuilder
+ => builder.WithMetadata(_excludeFromDescriptionMetadataAttribute);
+
+ /// <summary>
+ /// Adds the <see cref="IExcludeFromDescriptionMetadata"/> to <see cref="EndpointBuilder.Metadata"/> for all endpoints
+ /// produced by <paramref name="builder"/>.
+ /// </summary>
/// <param name="builder">The <see cref="RouteHandlerBuilder"/>.</param>
/// <returns>A <see cref="RouteHandlerBuilder"/> that can be used to further customize the endpoint.</returns>
public static RouteHandlerBuilder ExcludeFromDescription(this RouteHandlerBuilder builder)
- {
- builder.WithMetadata(_excludeFromDescriptionMetadataAttribute);
-
- return builder;
- }
+ => ExcludeFromDescription<RouteHandlerBuilder>(builder);
/// <summary>
/// Adds an <see cref="IProducesResponseTypeMetadata"/> to <see cref="EndpointBuilder.Metadata"/> for all endpoints
@@ -40,9 +45,10 @@ public static class OpenApiRouteHandlerBuilderExtensions
/// <param name="additionalContentTypes">Additional response content types the endpoint produces for the supplied status code.</param>
/// <returns>A <see cref="RouteHandlerBuilder"/> that can be used to further customize the endpoint.</returns>
#pragma warning disable RS0026
- public static RouteHandlerBuilder Produces<TResponse>(this RouteHandlerBuilder builder,
+ public static RouteHandlerBuilder Produces<TResponse>(
#pragma warning restore RS0026
- int statusCode = StatusCodes.Status200OK,
+ this RouteHandlerBuilder builder,
+ int statusCode = StatusCodes.Status200OK,
string? contentType = null,
params string[] additionalContentTypes)
{
@@ -60,9 +66,10 @@ public static class OpenApiRouteHandlerBuilderExtensions
/// <param name="additionalContentTypes">Additional response content types the endpoint produces for the supplied status code.</param>
/// <returns>A <see cref="RouteHandlerBuilder"/> that can be used to further customize the endpoint.</returns>
#pragma warning disable RS0026
- public static RouteHandlerBuilder Produces(this RouteHandlerBuilder builder,
+ public static RouteHandlerBuilder Produces(
#pragma warning restore RS0026
- int statusCode,
+ this RouteHandlerBuilder builder,
+ int statusCode,
Type? responseType = null,
string? contentType = null,
params string[] additionalContentTypes)
@@ -74,13 +81,10 @@ public static class OpenApiRouteHandlerBuilderExtensions
if (contentType is null)
{
- builder.WithMetadata(new ProducesResponseTypeMetadata(responseType ?? typeof(void), statusCode));
- return builder;
+ return builder.WithMetadata(new ProducesResponseTypeMetadata(responseType ?? typeof(void), statusCode));
}
- builder.WithMetadata(new ProducesResponseTypeMetadata(responseType ?? typeof(void), statusCode, contentType, additionalContentTypes));
-
- return builder;
+ return builder.WithMetadata(new ProducesResponseTypeMetadata(responseType ?? typeof(void), statusCode, contentType, additionalContentTypes));
}
/// <summary>
@@ -91,16 +95,14 @@ public static class OpenApiRouteHandlerBuilderExtensions
/// <param name="statusCode">The response status code.</param>
/// <param name="contentType">The response content type. Defaults to "application/problem+json".</param>
/// <returns>A <see cref="RouteHandlerBuilder"/> that can be used to further customize the endpoint.</returns>
- public static RouteHandlerBuilder ProducesProblem(this RouteHandlerBuilder builder,
- int statusCode,
- string? contentType = null)
+ public static RouteHandlerBuilder ProducesProblem(this RouteHandlerBuilder builder, int statusCode, string? contentType = null)
{
if (string.IsNullOrEmpty(contentType))
{
contentType = "application/problem+json";
}
- return Produces<ProblemDetails>(builder, statusCode, contentType);
+ return Produces(builder, statusCode, typeof(ProblemDetails), contentType);
}
/// <summary>
@@ -111,7 +113,8 @@ public static class OpenApiRouteHandlerBuilderExtensions
/// <param name="statusCode">The response status code. Defaults to <see cref="StatusCodes.Status400BadRequest"/>.</param>
/// <param name="contentType">The response content type. Defaults to "application/problem+json".</param>
/// <returns>A <see cref="RouteHandlerBuilder"/> that can be used to further customize the endpoint.</returns>
- public static RouteHandlerBuilder ProducesValidationProblem(this RouteHandlerBuilder builder,
+ public static RouteHandlerBuilder ProducesValidationProblem(
+ this RouteHandlerBuilder builder,
int statusCode = StatusCodes.Status400BadRequest,
string? contentType = null)
{
@@ -120,7 +123,7 @@ public static class OpenApiRouteHandlerBuilderExtensions
contentType = "application/problem+json";
}
- return Produces<HttpValidationProblemDetails>(builder, statusCode, contentType);
+ return Produces(builder, statusCode, typeof(HttpValidationProblemDetails), contentType);
}
/// <summary>
@@ -132,14 +135,26 @@ public static class OpenApiRouteHandlerBuilderExtensions
/// into related groups. These tags are typically included in the generated specification
/// and are typically used to group operations by tags in the UI.
/// </remarks>
+ /// <param name="builder">The <see cref="IEndpointConventionBuilder"/>.</param>
+ /// <param name="tags">A collection of tags to be associated with the endpoint.</param>
+ /// <returns>A <see cref="RouteHandlerBuilder"/> that can be used to further customize the endpoint.</returns>
+ public static TBuilder WithTags<TBuilder>(this TBuilder builder, params string[] tags) where TBuilder : IEndpointConventionBuilder
+ => builder.WithMetadata(new TagsAttribute(tags));
+
+ /// <summary>
+ /// Adds the <see cref="ITagsMetadata"/> to <see cref="EndpointBuilder.Metadata"/> for all endpoints
+ /// produced by <paramref name="builder"/>.
+ /// </summary>
+ /// <remarks>
+ /// The OpenAPI specification supports a tags classification to categorize operations
+ /// into related groups. These tags are typically included in the generated specification
+ /// and are typically used to group operations by tags in the UI.
+ /// </remarks>
/// <param name="builder">The <see cref="RouteHandlerBuilder"/>.</param>
/// <param name="tags">A collection of tags to be associated with the endpoint.</param>
/// <returns>A <see cref="RouteHandlerBuilder"/> that can be used to further customize the endpoint.</returns>
public static RouteHandlerBuilder WithTags(this RouteHandlerBuilder builder, params string[] tags)
- {
- builder.WithMetadata(new TagsAttribute(tags));
- return builder;
- }
+ => WithTags<RouteHandlerBuilder>(builder, tags);
/// <summary>
/// Adds <see cref="IAcceptsMetadata"/> to <see cref="EndpointBuilder.Metadata"/> for all endpoints
@@ -150,12 +165,12 @@ public static class OpenApiRouteHandlerBuilderExtensions
/// <param name="contentType">The request content type that the endpoint accepts.</param>
/// <param name="additionalContentTypes">The list of additional request content types that the endpoint accepts.</param>
/// <returns>A <see cref="RouteHandlerBuilder"/> that can be used to further customize the endpoint.</returns>
- public static RouteHandlerBuilder Accepts<TRequest>(this RouteHandlerBuilder builder,
- string contentType, params string[] additionalContentTypes) where TRequest : notnull
+ public static RouteHandlerBuilder Accepts<TRequest>(
+ this RouteHandlerBuilder builder,
+ string contentType,
+ params string[] additionalContentTypes) where TRequest : notnull
{
- Accepts(builder, typeof(TRequest), contentType, additionalContentTypes);
-
- return builder;
+ return Accepts(builder, typeof(TRequest), contentType, additionalContentTypes);
}
/// <summary>
@@ -168,12 +183,13 @@ public static class OpenApiRouteHandlerBuilderExtensions
/// <param name="contentType">The request content type that the endpoint accepts.</param>
/// <param name="additionalContentTypes">The list of additional request content types that the endpoint accepts.</param>
/// <returns>A <see cref="RouteHandlerBuilder"/> that can be used to further customize the endpoint.</returns>
- public static RouteHandlerBuilder Accepts<TRequest>(this RouteHandlerBuilder builder,
- bool isOptional, string contentType, params string[] additionalContentTypes) where TRequest : notnull
+ public static RouteHandlerBuilder Accepts<TRequest>(
+ this RouteHandlerBuilder builder,
+ bool isOptional,
+ string contentType,
+ params string[] additionalContentTypes) where TRequest : notnull
{
- Accepts(builder, typeof(TRequest), isOptional, contentType, additionalContentTypes);
-
- return builder;
+ return Accepts(builder, typeof(TRequest), isOptional, contentType, additionalContentTypes);
}
/// <summary>
@@ -185,11 +201,13 @@ public static class OpenApiRouteHandlerBuilderExtensions
/// <param name="contentType">The request content type that the endpoint accepts.</param>
/// <param name="additionalContentTypes">The list of additional request content types that the endpoint accepts.</param>
/// <returns>A <see cref="RouteHandlerBuilder"/> that can be used to further customize the endpoint.</returns>
- public static RouteHandlerBuilder Accepts(this RouteHandlerBuilder builder,
- Type requestType, string contentType, params string[] additionalContentTypes)
+ public static RouteHandlerBuilder Accepts(
+ this RouteHandlerBuilder builder,
+ Type requestType,
+ string contentType,
+ params string[] additionalContentTypes)
{
- builder.WithMetadata(new AcceptsMetadata(requestType, false, GetAllContentTypes(contentType, additionalContentTypes)));
- return builder;
+ return Accepts(builder, requestType, isOptional: false, contentType, additionalContentTypes);
}
/// <summary>
@@ -202,38 +220,36 @@ public static class OpenApiRouteHandlerBuilderExtensions
/// <param name="contentType">The request content type that the endpoint accepts.</param>
/// <param name="additionalContentTypes">The list of additional request content types that the endpoint accepts.</param>
/// <returns>A <see cref="RouteHandlerBuilder"/> that can be used to further customize the endpoint.</returns>
- public static RouteHandlerBuilder Accepts(this RouteHandlerBuilder builder,
- Type requestType, bool isOptional, string contentType, params string[] additionalContentTypes)
+ public static RouteHandlerBuilder Accepts(
+ this RouteHandlerBuilder builder,
+ Type requestType,
+ bool isOptional,
+ string contentType,
+ params string[] additionalContentTypes)
{
- builder.WithMetadata(new AcceptsMetadata(requestType, isOptional, GetAllContentTypes(contentType, additionalContentTypes)));
- return builder;
+ var contentTypes = GetAllContentTypes(contentType, additionalContentTypes);
+ return builder.WithMetadata(new AcceptsMetadata(requestType, isOptional, contentTypes));
}
/// <summary>
/// Adds <see cref="IEndpointDescriptionMetadata"/> to <see cref="EndpointBuilder.Metadata"/> for all endpoints
/// produced by <paramref name="builder"/>.
/// </summary>
- /// <param name="builder">The <see cref="RouteHandlerBuilder"/>.</param>
+ /// <param name="builder">The <see cref="IEndpointConventionBuilder"/>.</param>
/// <param name="description">A string representing a detailed description of the endpoint.</param>
/// <returns>A <see cref="RouteHandlerBuilder"/> that can be used to further customize the endpoint.</returns>
- public static RouteHandlerBuilder WithDescription(this RouteHandlerBuilder builder, string description)
- {
- builder.WithMetadata(new EndpointDescriptionAttribute(description));
- return builder;
- }
+ public static TBuilder WithDescription<TBuilder>(this TBuilder builder, string description) where TBuilder : IEndpointConventionBuilder
+ => builder.WithMetadata(new EndpointDescriptionAttribute(description));
/// <summary>
/// Adds <see cref="IEndpointSummaryMetadata"/> to <see cref="EndpointBuilder.Metadata"/> for all endpoints
/// produced by <paramref name="builder"/>.
/// </summary>
- /// <param name="builder">The <see cref="RouteHandlerBuilder"/>.</param>
+ /// <param name="builder">The <see cref="IEndpointConventionBuilder"/>.</param>
/// <param name="summary">A string representing a brief description of the endpoint.</param>
/// <returns>A <see cref="RouteHandlerBuilder"/> that can be used to further customize the endpoint.</returns>
- public static RouteHandlerBuilder WithSummary(this RouteHandlerBuilder builder, string summary)
- {
- builder.WithMetadata(new EndpointSummaryAttribute(summary));
- return builder;
- }
+ public static TBuilder WithSummary<TBuilder>(this TBuilder builder, string summary) where TBuilder : IEndpointConventionBuilder
+ => builder.WithMetadata(new EndpointSummaryAttribute(summary));
private static string[] GetAllContentTypes(string contentType, string[] additionalContentTypes)
{
diff --git a/src/Http/Routing/src/PublicAPI.Unshipped.txt b/src/Http/Routing/src/PublicAPI.Unshipped.txt
index 8b60014294..744183b0c6 100644
--- a/src/Http/Routing/src/PublicAPI.Unshipped.txt
+++ b/src/Http/Routing/src/PublicAPI.Unshipped.txt
@@ -11,12 +11,14 @@ static Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions.MapPatch(this
override Microsoft.AspNetCore.Routing.RouteValuesAddress.ToString() -> string?
*REMOVED*~Microsoft.AspNetCore.Routing.DefaultInlineConstraintResolver.DefaultInlineConstraintResolver(Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Routing.RouteOptions!>! routeOptions, System.IServiceProvider! serviceProvider) -> void
Microsoft.AspNetCore.Routing.DefaultInlineConstraintResolver.DefaultInlineConstraintResolver(Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Routing.RouteOptions!>! routeOptions, System.IServiceProvider! serviceProvider) -> void
+static Microsoft.AspNetCore.Http.OpenApiRouteHandlerBuilderExtensions.ExcludeFromDescription<TBuilder>(this TBuilder builder) -> TBuilder
+static Microsoft.AspNetCore.Http.OpenApiRouteHandlerBuilderExtensions.WithDescription<TBuilder>(this TBuilder builder, string! description) -> TBuilder
+static Microsoft.AspNetCore.Http.OpenApiRouteHandlerBuilderExtensions.WithSummary<TBuilder>(this TBuilder builder, string! summary) -> TBuilder
+static Microsoft.AspNetCore.Http.OpenApiRouteHandlerBuilderExtensions.WithTags<TBuilder>(this TBuilder builder, params string![]! tags) -> TBuilder
static Microsoft.AspNetCore.Http.RouteHandlerFilterExtensions.AddFilter(this Microsoft.AspNetCore.Builder.RouteHandlerBuilder! builder, Microsoft.AspNetCore.Http.IRouteHandlerFilter! filter) -> Microsoft.AspNetCore.Builder.RouteHandlerBuilder!
static Microsoft.AspNetCore.Http.RouteHandlerFilterExtensions.AddFilter(this Microsoft.AspNetCore.Builder.RouteHandlerBuilder! builder, System.Func<Microsoft.AspNetCore.Http.RouteHandlerContext!, Microsoft.AspNetCore.Http.RouteHandlerFilterDelegate!, Microsoft.AspNetCore.Http.RouteHandlerFilterDelegate!>! filterFactory) -> Microsoft.AspNetCore.Builder.RouteHandlerBuilder!
static Microsoft.AspNetCore.Http.RouteHandlerFilterExtensions.AddFilter(this Microsoft.AspNetCore.Builder.RouteHandlerBuilder! builder, System.Func<Microsoft.AspNetCore.Http.RouteHandlerInvocationContext!, Microsoft.AspNetCore.Http.RouteHandlerFilterDelegate!, System.Threading.Tasks.ValueTask<object?>>! routeHandlerFilter) -> Microsoft.AspNetCore.Builder.RouteHandlerBuilder!
static Microsoft.AspNetCore.Http.RouteHandlerFilterExtensions.AddFilter<TFilterType>(this Microsoft.AspNetCore.Builder.RouteHandlerBuilder! builder) -> Microsoft.AspNetCore.Builder.RouteHandlerBuilder!
-static Microsoft.AspNetCore.Http.OpenApiRouteHandlerBuilderExtensions.WithDescription(this Microsoft.AspNetCore.Builder.RouteHandlerBuilder! builder, string! description) -> Microsoft.AspNetCore.Builder.RouteHandlerBuilder!
-static Microsoft.AspNetCore.Http.OpenApiRouteHandlerBuilderExtensions.WithSummary(this Microsoft.AspNetCore.Builder.RouteHandlerBuilder! builder, string! summary) -> Microsoft.AspNetCore.Builder.RouteHandlerBuilder!
static Microsoft.AspNetCore.Routing.LinkGeneratorEndpointNameAddressExtensions.GetPathByName(this Microsoft.AspNetCore.Routing.LinkGenerator! generator, Microsoft.AspNetCore.Http.HttpContext! httpContext, string! endpointName, Microsoft.AspNetCore.Routing.RouteValueDictionary? values = null, Microsoft.AspNetCore.Http.PathString? pathBase = null, Microsoft.AspNetCore.Http.FragmentString fragment = default(Microsoft.AspNetCore.Http.FragmentString), Microsoft.AspNetCore.Routing.LinkOptions? options = null) -> string?
static Microsoft.AspNetCore.Routing.LinkGeneratorEndpointNameAddressExtensions.GetPathByName(this Microsoft.AspNetCore.Routing.LinkGenerator! generator, string! endpointName, Microsoft.AspNetCore.Routing.RouteValueDictionary? values = null, Microsoft.AspNetCore.Http.PathString pathBase = default(Microsoft.AspNetCore.Http.PathString), Microsoft.AspNetCore.Http.FragmentString fragment = default(Microsoft.AspNetCore.Http.FragmentString), Microsoft.AspNetCore.Routing.LinkOptions? options = null) -> string?
static Microsoft.AspNetCore.Routing.LinkGeneratorEndpointNameAddressExtensions.GetUriByName(this Microsoft.AspNetCore.Routing.LinkGenerator! generator, Microsoft.AspNetCore.Http.HttpContext! httpContext, string! endpointName, Microsoft.AspNetCore.Routing.RouteValueDictionary? values = null, string? scheme = null, Microsoft.AspNetCore.Http.HostString? host = null, Microsoft.AspNetCore.Http.PathString? pathBase = null, Microsoft.AspNetCore.Http.FragmentString fragment = default(Microsoft.AspNetCore.Http.FragmentString), Microsoft.AspNetCore.Routing.LinkOptions? options = null) -> string?
diff --git a/src/Http/Routing/test/UnitTests/Builder/OpenApiRouteHandlerBuilderExtensionsTest.cs b/src/Http/Routing/test/UnitTests/Builder/OpenApiRouteHandlerBuilderExtensionsTest.cs
new file mode 100644
index 0000000000..54a87d2aa5
--- /dev/null
+++ b/src/Http/Routing/test/UnitTests/Builder/OpenApiRouteHandlerBuilderExtensionsTest.cs
@@ -0,0 +1,158 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Http.Metadata;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Microsoft.AspNetCore.Routing.Builder;
+
+public class OpenApiRouteHandlerBuilderExtensionsTest
+{
+ [Fact]
+ public void ExcludeFromDescription_AddsExcludeFromDescriptionAttribute()
+ {
+ static void GenericExclude(IEndpointConventionBuilder builder) => builder.ExcludeFromDescription();
+ static void SpecificExclude(RouteHandlerBuilder builder) => builder.ExcludeFromDescription();
+
+ static void AssertMetadata(EndpointBuilder builder)
+ => Assert.IsType<ExcludeFromDescriptionAttribute>(Assert.Single(builder.Metadata));
+
+ RunWithBothBuilders(GenericExclude, SpecificExclude, AssertMetadata);
+ }
+
+ [Fact]
+ public void WithTags_AddsTagsAttribute()
+ {
+ static void GenericWithTags(IEndpointConventionBuilder builder) => builder.WithTags("a", "b", "c");
+ static void SpecificWithTags(RouteHandlerBuilder builder) => builder.WithTags("a", "b", "c");
+
+ static void AssertMetadata(EndpointBuilder builder)
+ {
+ var tags = Assert.IsType<TagsAttribute>(Assert.Single(builder.Metadata));
+ Assert.Collection(tags.Tags,
+ tag => Assert.Equal("a", tag),
+ tag => Assert.Equal("b", tag),
+ tag => Assert.Equal("c", tag));
+ }
+
+ RunWithBothBuilders(GenericWithTags, SpecificWithTags, AssertMetadata);
+ }
+
+ [Fact]
+ public void Produces_AddsProducesResponseTypeMetadataWithJsonContentType()
+ {
+ var testBuilder = new TestEndointConventionBuilder();
+ var builder = new RouteHandlerBuilder(new[] { testBuilder });
+
+ builder.Produces<TestEndointConventionBuilder>();
+
+ var metadata = Assert.IsType<ProducesResponseTypeMetadata>(Assert.Single(testBuilder.Metadata));
+ Assert.Equal(typeof(TestEndointConventionBuilder), metadata.Type);
+ Assert.Equal(StatusCodes.Status200OK, metadata.StatusCode);
+ Assert.Equal("application/json", Assert.Single(metadata.ContentTypes));
+ }
+
+ [Fact]
+ public void Produces_AddsProducesResponseTypeMetadataWithVoidType()
+ {
+ var testBuilder = new TestEndointConventionBuilder();
+ var builder = new RouteHandlerBuilder(new[] { testBuilder });
+
+ builder.Produces(StatusCodes.Status404NotFound);
+
+ var metadata = Assert.IsType<ProducesResponseTypeMetadata>(Assert.Single(testBuilder.Metadata));
+ Assert.Equal(typeof(void), metadata.Type);
+ Assert.Equal(StatusCodes.Status404NotFound, metadata.StatusCode);
+ Assert.Empty(metadata.ContentTypes);
+ }
+
+ [Fact]
+ public void ProdcesProblem_AddsProducesResponseTypeMetadataWithProblemDetailsType()
+ {
+ var testBuilder = new TestEndointConventionBuilder();
+ var builder = new RouteHandlerBuilder(new[] { testBuilder });
+
+ builder.ProducesProblem(StatusCodes.Status400BadRequest);
+
+ var metadata = Assert.IsType<ProducesResponseTypeMetadata>(Assert.Single(testBuilder.Metadata));
+ Assert.Equal(typeof(ProblemDetails), metadata.Type);
+ Assert.Equal(StatusCodes.Status400BadRequest, metadata.StatusCode);
+ Assert.Equal("application/problem+json", Assert.Single(metadata.ContentTypes));
+ }
+
+ [Fact]
+ public void ProdcesValidiationProblem_AddsProducesResponseTypeMetadataWithHttpValidationProblemDetailsType()
+ {
+ var testBuilder = new TestEndointConventionBuilder();
+ var builder = new RouteHandlerBuilder(new[] { testBuilder });
+
+ builder.ProducesValidationProblem();
+
+ var metadata = Assert.IsType<ProducesResponseTypeMetadata>(Assert.Single(testBuilder.Metadata));
+ Assert.Equal(typeof(HttpValidationProblemDetails), metadata.Type);
+ Assert.Equal(StatusCodes.Status400BadRequest, metadata.StatusCode);
+ Assert.Equal("application/problem+json", Assert.Single(metadata.ContentTypes));
+ }
+
+ [Fact]
+ public void Accepts_AddsAcceptsMetadataWithSpecifiedType()
+ {
+ var testBuilder = new TestEndointConventionBuilder();
+ var builder = new RouteHandlerBuilder(new[] { testBuilder });
+
+ builder.Accepts<TestEndointConventionBuilder>("text/plain");
+
+ var metadata = Assert.IsType<AcceptsMetadata>(Assert.Single(testBuilder.Metadata));
+
+ Assert.Equal(typeof(TestEndointConventionBuilder), metadata.RequestType);
+ Assert.Equal("text/plain", Assert.Single(metadata.ContentTypes));
+ Assert.False(metadata.IsOptional);
+ }
+
+ [Fact]
+ public void WithDescription_AddsEndpointDescriptionAttribute()
+ {
+ var builder = new TestEndointConventionBuilder();
+ builder.WithDescription("test description");
+
+ var metadata = Assert.IsType<EndpointDescriptionAttribute>(Assert.Single(builder.Metadata));
+ Assert.Equal("test description", metadata.Description);
+ }
+
+ [Fact]
+ public void WithSummary_AddsEndpointSummaryAttribute()
+ {
+ var builder = new TestEndointConventionBuilder();
+ builder.WithSummary("test summary");
+
+ var metadata = Assert.IsType<EndpointSummaryAttribute>(Assert.Single(builder.Metadata));
+ Assert.Equal("test summary", metadata.Summary);
+ }
+
+ private void RunWithBothBuilders(
+ Action<IEndpointConventionBuilder> genericSetup,
+ Action<RouteHandlerBuilder> specificSetup,
+ Action<EndpointBuilder> assert)
+ {
+ var testBuilder = new TestEndointConventionBuilder();
+ genericSetup(testBuilder);
+ assert(testBuilder);
+
+ var routeTestBuilder = new TestEndointConventionBuilder();
+ var routeHandlerBuilder = new RouteHandlerBuilder(new[] { routeTestBuilder });
+ specificSetup(routeHandlerBuilder);
+ assert(routeTestBuilder);
+ }
+
+ private sealed class TestEndointConventionBuilder : EndpointBuilder, IEndpointConventionBuilder
+ {
+ public void Add(Action<EndpointBuilder> convention)
+ {
+ convention(this);
+ }
+
+ public override Endpoint Build() => throw new NotImplementedException();
+ }
+}
diff --git a/src/Http/Routing/test/UnitTests/Builder/RouteHandlerEndpointRouteBuilderExtensionsTest.cs b/src/Http/Routing/test/UnitTests/Builder/RouteHandlerEndpointRouteBuilderExtensionsTest.cs
index 4f7db98695..65db53c1e7 100644
--- a/src/Http/Routing/test/UnitTests/Builder/RouteHandlerEndpointRouteBuilderExtensionsTest.cs
+++ b/src/Http/Routing/test/UnitTests/Builder/RouteHandlerEndpointRouteBuilderExtensionsTest.cs
@@ -901,6 +901,7 @@ public class RouteHandlerEndpointRouteBuilderExtensionsTest : LoggedTest
{
Assert.NotNull(routeHandlerContext.MethodInfo);
Assert.NotNull(routeHandlerContext.MethodInfo.DeclaringType);
+ Assert.NotNull(routeHandlerContext.ApplicationServices);
Assert.Equal("RouteHandlerEndpointRouteBuilderExtensionsTest", routeHandlerContext.MethodInfo.DeclaringType?.Name);
context.Arguments[0] = context.GetArgument<int>(0) + 1;
return await next(context);
@@ -972,6 +973,54 @@ public class RouteHandlerEndpointRouteBuilderExtensionsTest : LoggedTest
Assert.Equal("loggerErrorIsEnabled: True, parentName: RouteHandlerEndpointRouteBuilderExtensionsTest", body);
}
+ [Fact]
+ public void RequestDelegateFactory_ProvidesAppServiceProvider_ToFilterFactory()
+ {
+ var appServiceCollection = new ServiceCollection();
+ var appService = new MyService();
+ appServiceCollection.AddSingleton(appService);
+ var builder = new DefaultEndpointRouteBuilder(new ApplicationBuilder(appServiceCollection.BuildServiceProvider()));
+ var filterFactoryRan = false;
+
+ string? PrintLogger(HttpContext context) => $"loggerErrorIsEnabled: {context.Items["loggerErrorIsEnabled"]}, parentName: {context.Items["parentName"]}";
+ var routeHandlerBuilder = builder.Map("/", PrintLogger);
+ routeHandlerBuilder.AddFilter((rhc, next) =>
+ {
+ Assert.NotNull(rhc.ApplicationServices);
+ var myService = rhc.ApplicationServices.GetRequiredService<MyService>();
+ Assert.Equal(appService, myService);
+ filterFactoryRan = true;
+ return next;
+ });
+
+ var dataSource = GetBuilderEndpointDataSource(builder);
+ // Trigger Endpoint build by calling getter.
+ Assert.Single(dataSource.Endpoints);
+ Assert.True(filterFactoryRan);
+ }
+
+ [Fact]
+ public void RouteHandlerContext_ThrowsArgumentNullException_ForMethodInfo()
+ {
+ Assert.Throws<ArgumentNullException>("methodInfo", () => new RouteHandlerContext(null!, new(), new ServiceCollection().BuildServiceProvider()));
+ }
+
+ [Fact]
+ public void RouteHandlerContext_ThrowsArgumentNullException_ForEndpointMetadata()
+ {
+ var handler = () => { };
+ Assert.Throws<ArgumentNullException>("endpointMetadata", () => new RouteHandlerContext(handler.Method, null!, new ServiceCollection().BuildServiceProvider()));
+ }
+
+ [Fact]
+ public void RouteHandlerContext_ThrowsArgumentNullException_ForApplicationServices()
+ {
+ var handler = () => { };
+ Assert.Throws<ArgumentNullException>("applicationServices", () => new RouteHandlerContext(handler.Method, new(), null!));
+ }
+
+ class MyService { }
+
class ServiceAccessingRouteHandlerFilter : IRouteHandlerFilter
{
private ILogger _logger;
diff --git a/src/Http/samples/MinimalSample/Program.cs b/src/Http/samples/MinimalSample/Program.cs
index 52d87b8dba..1b100483c0 100644
--- a/src/Http/samples/MinimalSample/Program.cs
+++ b/src/Http/samples/MinimalSample/Program.cs
@@ -26,7 +26,7 @@ app.MapGet("/", () => message);
var nestedGroup = app.MapGroup("/group/{groupName}")
.MapGroup("/nested/{nestedName}")
- .WithMetadata(new TagsAttribute("nested"));
+ .WithTags("nested");
nestedGroup
.MapGet("/", (string groupName, string nestedName) =>
diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ForgotPassword.cshtml b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ForgotPassword.cshtml
index 704576801c..106b8d1221 100644
--- a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ForgotPassword.cshtml
+++ b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ForgotPassword.cshtml
@@ -11,8 +11,8 @@
<div class="col-md-4">
<form method="post">
<div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div>
- <div class="form-floating">
- <input asp-for="Input.Email" class="form-control" autocomplete="username" aria-required="true" />
+ <div class="form-floating mb-3">
+ <input asp-for="Input.Email" class="form-control" autocomplete="username" aria-required="true" placeholder="name@example.com" />
<label asp-for="Input.Email" class="form-label"></label>
<span asp-validation-for="Input.Email" class="text-danger"></span>
</div>
diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Login.cshtml b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Login.cshtml
index 6aadfbdf01..c7dbd6c6f3 100644
--- a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Login.cshtml
+++ b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Login.cshtml
@@ -13,14 +13,14 @@
<h2>Use a local account to log in.</h2>
<hr />
<div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div>
- <div class="form-floating">
- <input asp-for="Input.Email" class="form-control" autocomplete="username" aria-required="true" />
- <label asp-for="Input.Email" class="form-label"></label>
+ <div class="form-floating mb-3">
+ <input asp-for="Input.Email" class="form-control" autocomplete="username" aria-required="true" placeholder="name@example.com" />
+ <label asp-for="Input.Email" class="form-label">Email</label>
<span asp-validation-for="Input.Email" class="text-danger"></span>
</div>
<div class="form-floating">
- <input asp-for="Input.Password" class="form-control" autocomplete="current-password" aria-required="true" />
- <label asp-for="Input.Password" class="form-label"></label>
+ <input asp-for="Input.Password" class="form-control" autocomplete="current-password" aria-required="true" placeholder="password" />
+ <label asp-for="Input.Password" class="form-label">Password</label>
<span asp-validation-for="Input.Password" class="text-danger"></span>
</div>
<div>
diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Register.cshtml b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Register.cshtml
index 578b1a58a1..6fbfc8fa4a 100644
--- a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Register.cshtml
+++ b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Register.cshtml
@@ -12,19 +12,19 @@
<h2>Create a new account.</h2>
<hr />
<div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div>
- <div class="form-floating">
- <input asp-for="Input.Email" class="form-control" autocomplete="username" aria-required="true" />
- <label asp-for="Input.Email"></label>
+ <div class="form-floating mb-3">
+ <input asp-for="Input.Email" class="form-control" autocomplete="username" aria-required="true" placeholder="name@example.com" />
+ <label asp-for="Input.Email">Email</label>
<span asp-validation-for="Input.Email" class="text-danger"></span>
</div>
- <div class="form-floating">
- <input asp-for="Input.Password" class="form-control" autocomplete="new-password" aria-required="true" />
- <label asp-for="Input.Password"></label>
+ <div class="form-floating mb-3">
+ <input asp-for="Input.Password" class="form-control" autocomplete="new-password" aria-required="true" placeholder="password" />
+ <label asp-for="Input.Password">Password</label>
<span asp-validation-for="Input.Password" class="text-danger"></span>
</div>
- <div class="form-floating">
- <input asp-for="Input.ConfirmPassword" class="form-control" autocomplete="new-password" aria-required="true" />
- <label asp-for="Input.ConfirmPassword"></label>
+ <div class="form-floating mb-3">
+ <input asp-for="Input.ConfirmPassword" class="form-control" autocomplete="new-password" aria-required="true" placeholder="password" />
+ <label asp-for="Input.ConfirmPassword">Confirm Password</label>
<span asp-validation-for="Input.ConfirmPassword" class="text-danger"></span>
</div>
<button id="registerSubmit" type="submit" class="w-100 btn btn-lg btn-primary">Register</button>
diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ResendEmailConfirmation.cshtml b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ResendEmailConfirmation.cshtml
index c9c4dd097b..d457b6b8bb 100644
--- a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ResendEmailConfirmation.cshtml
+++ b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ResendEmailConfirmation.cshtml
@@ -11,8 +11,8 @@
<div class="col-md-4">
<form method="post">
<div asp-validation-summary="All" class="text-danger" role="alert"></div>
- <div class="form-floating">
- <input asp-for="Input.Email" class="form-control" aria-required="true" />
+ <div class="form-floating mb-3">
+ <input asp-for="Input.Email" class="form-control" aria-required="true" placeholder="name@example.com" />
<label asp-for="Input.Email" class="form-label"></label>
<span asp-validation-for="Input.Email" class="text-danger"></span>
</div>
diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ResetPassword.cshtml b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ResetPassword.cshtml
index 494c0bf5dc..d0ea1bd126 100644
--- a/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ResetPassword.cshtml
+++ b/src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ResetPassword.cshtml
@@ -12,8 +12,8 @@
<form method="post">
<div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div>
<input asp-for="Input.Code" type="hidden" />
- <div class="form-floating">
- <input asp-for="Input.Email" class="form-control" autocomplete="username" aria-required="true" />
+ <div class="form-floating mb-3">
+ <input asp-for="Input.Email" class="form-control" autocomplete="username" aria-required="true" placeholder="name@example.com" />
<label asp-for="Input.Email" class="form-label"></label>
<span asp-validation-for="Input.Email" class="text-danger"></span>
</div>
diff --git a/src/JSInterop/Microsoft.JSInterop/src/Infrastructure/DotNetDispatcher.cs b/src/JSInterop/Microsoft.JSInterop/src/Infrastructure/DotNetDispatcher.cs
index 08821b795d..38e84716e1 100644
--- a/src/JSInterop/Microsoft.JSInterop/src/Infrastructure/DotNetDispatcher.cs
+++ b/src/JSInterop/Microsoft.JSInterop/src/Infrastructure/DotNetDispatcher.cs
@@ -41,6 +41,7 @@ public static class DotNetDispatcher
/// <param name="invocationInfo">The <see cref="DotNetInvocationInfo"/>.</param>
/// <param name="argsJson">A JSON representation of the parameters.</param>
/// <returns>A JSON representation of the return value, or null.</returns>
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "We expect application code is configured to ensure return types of JSInvokable methods are retained.")]
public static string? Invoke(JSRuntime jsRuntime, in DotNetInvocationInfo invocationInfo, string argsJson)
{
// This method doesn't need [JSInvokable] because the platform is responsible for having
@@ -70,6 +71,7 @@ public static class DotNetDispatcher
/// <param name="invocationInfo">The <see cref="DotNetInvocationInfo"/>.</param>
/// <param name="argsJson">A JSON representation of the parameters.</param>
/// <returns>A JSON representation of the return value, or null.</returns>
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "We expect application code is configured to ensure return types of JSInvokable methods are retained.")]
public static void BeginInvokeDotNet(JSRuntime jsRuntime, DotNetInvocationInfo invocationInfo, string argsJson)
{
// This method doesn't need [JSInvokable] because the platform is responsible for having
@@ -136,6 +138,7 @@ public static class DotNetDispatcher
}
}
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "We expect application code is configured to ensure return types of JSInvokable methods are retained.")]
private static void EndInvokeDotNetAfterTask(Task task, JSRuntime jsRuntime, in DotNetInvocationInfo invocationInfo)
{
if (task.Exception != null)
@@ -208,6 +211,7 @@ public static class DotNetDispatcher
}
}
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "We expect application code is configured to ensure return types of JSInvokable methods are retained.")]
internal static object?[] ParseArguments(JSRuntime jsRuntime, string methodIdentifier, string arguments, Type[] parameterTypes)
{
if (parameterTypes.Length == 0)
@@ -425,6 +429,7 @@ public static class DotNetDispatcher
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026", Justification = "We expect application code is configured to ensure JSInvokable methods are retained. https://github.com/dotnet/aspnetcore/issues/29946")]
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2072", Justification = "We expect application code is configured to ensure JSInvokable methods are retained. https://github.com/dotnet/aspnetcore/issues/29946")]
+ [UnconditionalSuppressMessage("Trimming", "IL2075", Justification = "We expect application code is configured to ensure JSInvokable methods are retained. https://github.com/dotnet/aspnetcore/issues/29946")]
private static Dictionary<string, (MethodInfo, Type[])> ScanAssemblyForCallableMethods(AssemblyKey assemblyKey)
{
// TODO: Consider looking first for assembly-level attributes (i.e., if there are any,
diff --git a/src/JSInterop/Microsoft.JSInterop/src/Infrastructure/DotNetObjectReferenceJsonConverterFactory.cs b/src/JSInterop/Microsoft.JSInterop/src/Infrastructure/DotNetObjectReferenceJsonConverterFactory.cs
index 8c1bb14d21..b769b949d9 100644
--- a/src/JSInterop/Microsoft.JSInterop/src/Infrastructure/DotNetObjectReferenceJsonConverterFactory.cs
+++ b/src/JSInterop/Microsoft.JSInterop/src/Infrastructure/DotNetObjectReferenceJsonConverterFactory.cs
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Serialization;
@@ -20,6 +21,7 @@ internal sealed class DotNetObjectReferenceJsonConverterFactory : JsonConverterF
return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(DotNetObjectReference<>);
}
+ [UnconditionalSuppressMessage("Trimming", "IL2055", Justification = "We expect that types used with DotNetObjectReference are retained.")]
public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
{
// System.Text.Json handles caching the converters per type on our behalf. No caching is required here.
diff --git a/src/JSInterop/Microsoft.JSInterop/src/JSRuntime.cs b/src/JSInterop/Microsoft.JSInterop/src/JSRuntime.cs
index 9b0e25f27a..59cc9153d7 100644
--- a/src/JSInterop/Microsoft.JSInterop/src/JSRuntime.cs
+++ b/src/JSInterop/Microsoft.JSInterop/src/JSRuntime.cs
@@ -94,6 +94,7 @@ public abstract partial class JSRuntime : IJSRuntime, IDisposable
return await InvokeAsync<TValue>(targetInstanceId, identifier, CancellationToken.None, args);
}
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "We expect application code is configured to ensure JS interop arguments are linker friendly.")]
internal ValueTask<TValue> InvokeAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(
long targetInstanceId,
string identifier,
@@ -225,6 +226,7 @@ public abstract partial class JSRuntime : IJSRuntime, IDisposable
}
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2072:RequiresUnreferencedCode", Justification = "We enforce trimmer attributes for JSON deserialized types on InvokeAsync.")]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "We enforce trimmer attributes for JSON deserialized types on InvokeAsync.")]
internal bool EndInvokeJS(long taskId, bool succeeded, ref Utf8JsonReader jsonReader)
{
if (!_pendingTasks.TryRemove(taskId, out var tcs))
diff --git a/src/Middleware/HttpLogging/samples/Logging.W3C.Sample/Startup.cs b/src/Middleware/HttpLogging/samples/Logging.W3C.Sample/Startup.cs
index f340c64143..b8e451c978 100644
--- a/src/Middleware/HttpLogging/samples/Logging.W3C.Sample/Startup.cs
+++ b/src/Middleware/HttpLogging/samples/Logging.W3C.Sample/Startup.cs
@@ -15,6 +15,9 @@ public class Startup
{
// Log all W3C fields
logging.LoggingFields = W3CLoggingFields.All;
+ logging.AdditionalRequestHeaders.Clear();
+ logging.AdditionalRequestHeaders.Add("x-forwarded-for");
+ logging.AdditionalRequestHeaders.Add("x-client-ssl-protocol");
});
}
diff --git a/src/Middleware/HttpLogging/src/FileLoggerProcessor.cs b/src/Middleware/HttpLogging/src/FileLoggerProcessor.cs
index b3ab3dff72..3f9a317fd5 100644
--- a/src/Middleware/HttpLogging/src/FileLoggerProcessor.cs
+++ b/src/Middleware/HttpLogging/src/FileLoggerProcessor.cs
@@ -35,6 +35,7 @@ internal partial class FileLoggerProcessor : IAsyncDisposable
internal ISystemDateTime SystemDateTime { get; set; } = new SystemDateTime();
private readonly object _pathLock = new object();
+ private ISet<string> _additionalHeaders;
public FileLoggerProcessor(IOptionsMonitor<W3CLoggerOptions> options, IHostEnvironment environment, ILoggerFactory factory)
{
@@ -61,6 +62,8 @@ internal partial class FileLoggerProcessor : IAsyncDisposable
_maxRetainedFiles = loggerOptions.RetainedFileCountLimit;
_flushInterval = loggerOptions.FlushInterval;
_fields = loggerOptions.LoggingFields;
+ _additionalHeaders = W3CLoggerOptions.FilterRequestHeaders(loggerOptions);
+
_options.OnChange(options =>
{
lock (_pathLock)
@@ -69,7 +72,7 @@ internal partial class FileLoggerProcessor : IAsyncDisposable
loggerOptions = options;
// Move to a new file if the fields have changed
- if (_fields != loggerOptions.LoggingFields)
+ if (_fields != loggerOptions.LoggingFields || !_additionalHeaders.SetEquals(loggerOptions.AdditionalRequestHeaders))
{
_fileNumber++;
if (_fileNumber >= W3CLoggerOptions.MaxFileCount)
@@ -78,6 +81,7 @@ internal partial class FileLoggerProcessor : IAsyncDisposable
Log.MaxFilesReached(_logger);
}
_fields = loggerOptions.LoggingFields;
+ _additionalHeaders = W3CLoggerOptions.FilterRequestHeaders(loggerOptions);
}
if (!string.IsNullOrEmpty(loggerOptions.LogDirectory))
diff --git a/src/Middleware/HttpLogging/src/HttpLoggingOptions.cs b/src/Middleware/HttpLogging/src/HttpLoggingOptions.cs
index 06431c2900..13912e35df 100644
--- a/src/Middleware/HttpLogging/src/HttpLoggingOptions.cs
+++ b/src/Middleware/HttpLogging/src/HttpLoggingOptions.cs
@@ -20,6 +20,11 @@ public sealed class HttpLoggingOptions
/// <p>
/// If a request header is not present in the <see cref="RequestHeaders"/>,
/// the header name will be logged with a redacted value.
+ /// Request headers can contain authentication tokens,
+ /// or private information which may have regulatory concerns
+ /// under GDPR and other laws. Arbitrary request headers
+ /// should not be logged unless logs are secure and
+ /// access controlled and the privacy impact assessed.
/// </p>
/// </summary>
public ISet<string> RequestHeaders => _internalRequestHeaders;
diff --git a/src/Middleware/HttpLogging/src/PublicAPI.Unshipped.txt b/src/Middleware/HttpLogging/src/PublicAPI.Unshipped.txt
index 7dc5c58110..3f0003737c 100644
--- a/src/Middleware/HttpLogging/src/PublicAPI.Unshipped.txt
+++ b/src/Middleware/HttpLogging/src/PublicAPI.Unshipped.txt
@@ -1 +1,2 @@
#nullable enable
+Microsoft.AspNetCore.HttpLogging.W3CLoggerOptions.AdditionalRequestHeaders.get -> System.Collections.Generic.ISet<string!>!
diff --git a/src/Middleware/HttpLogging/src/W3CLogger.cs b/src/Middleware/HttpLogging/src/W3CLogger.cs
index 093595a48a..caad08f4c0 100644
--- a/src/Middleware/HttpLogging/src/W3CLogger.cs
+++ b/src/Middleware/HttpLogging/src/W3CLogger.cs
@@ -35,12 +35,12 @@ internal class W3CLogger : IAsyncDisposable
public ValueTask DisposeAsync() => _messageQueue.DisposeAsync();
- public void Log(string[] elements)
+ public void Log(string[] elements, string[] additionalHeaders)
{
- _messageQueue.EnqueueMessage(Format(elements));
+ _messageQueue.EnqueueMessage(Format(elements, additionalHeaders));
}
- private string Format(string[] elements)
+ private string Format(string[] elements, string[] additionalHeaders)
{
// 200 is around the length of an average cookie-less entry
var sb = new ValueStringBuilder(200);
@@ -68,6 +68,27 @@ internal class W3CLogger : IAsyncDisposable
}
}
}
+
+ for (var i = 0; i < additionalHeaders.Length; i++)
+ {
+ if (!firstElement)
+ {
+ sb.Append(' ');
+ }
+ else
+ {
+ firstElement = false;
+ }
+ // If the element was not logged, or was the empty string, we log it as a dash
+ if (string.IsNullOrEmpty(additionalHeaders[i]))
+ {
+ sb.Append('-');
+ }
+ else
+ {
+ sb.Append(additionalHeaders[i]);
+ }
+ }
return sb.ToString();
}
}
diff --git a/src/Middleware/HttpLogging/src/W3CLoggerOptions.cs b/src/Middleware/HttpLogging/src/W3CLoggerOptions.cs
index bb9406eb73..8ca86c7f33 100644
--- a/src/Middleware/HttpLogging/src/W3CLoggerOptions.cs
+++ b/src/Middleware/HttpLogging/src/W3CLoggerOptions.cs
@@ -1,6 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using Microsoft.Net.Http.Headers;
+
namespace Microsoft.AspNetCore.HttpLogging;
/// <summary>
@@ -107,6 +109,18 @@ public sealed class W3CLoggerOptions
}
/// <summary>
+ /// List of additional request header values to log.
+ /// <p>
+ /// Request headers can contain authentication tokens,
+ /// or private information which may have regulatory concerns
+ /// under GDPR and other laws. Arbitrary request headers
+ /// should not be logged unless logs are secure and
+ /// access controlled and the privacy impact assessed.
+ /// </p>
+ /// </summary>
+ public ISet<string> AdditionalRequestHeaders { get; } = new SortedSet<string>(StringComparer.OrdinalIgnoreCase);
+
+ /// <summary>
/// Fields to log. Defaults to logging request and response properties and headers,
/// plus date/time info and server name.
/// </summary>
@@ -115,4 +129,26 @@ public sealed class W3CLoggerOptions
W3CLoggingFields.ProtocolStatus | W3CLoggingFields.TimeTaken | W3CLoggingFields.ProtocolVersion |
W3CLoggingFields.Host | W3CLoggingFields.UserAgent | W3CLoggingFields.Referer | W3CLoggingFields.ConnectionInfoFields;
+ internal static ISet<string> FilterRequestHeaders(W3CLoggerOptions options)
+ {
+ var clonedSet = new SortedSet<string>(options.AdditionalRequestHeaders, StringComparer.InvariantCultureIgnoreCase);
+
+ if (options.LoggingFields.HasFlag(W3CLoggingFields.Host))
+ {
+ clonedSet.Remove(HeaderNames.Host);
+ }
+ if (options.LoggingFields.HasFlag(W3CLoggingFields.Referer))
+ {
+ clonedSet.Remove(HeaderNames.Referer);
+ }
+ if (options.LoggingFields.HasFlag(W3CLoggingFields.UserAgent))
+ {
+ clonedSet.Remove(HeaderNames.UserAgent);
+ }
+ if (options.LoggingFields.HasFlag(W3CLoggingFields.Cookie))
+ {
+ clonedSet.Remove(HeaderNames.Cookie);
+ }
+ return clonedSet;
+ }
}
diff --git a/src/Middleware/HttpLogging/src/W3CLoggerProcessor.cs b/src/Middleware/HttpLogging/src/W3CLoggerProcessor.cs
index 5fdd964849..d75d5f74fe 100644
--- a/src/Middleware/HttpLogging/src/W3CLoggerProcessor.cs
+++ b/src/Middleware/HttpLogging/src/W3CLoggerProcessor.cs
@@ -14,10 +14,12 @@ internal class W3CLoggerProcessor : FileLoggerProcessor
#pragma warning restore CA1852 // Seal internal types
{
private readonly W3CLoggingFields _loggingFields;
+ private readonly ISet<string>? _additionalRequestHeaders;
public W3CLoggerProcessor(IOptionsMonitor<W3CLoggerOptions> options, IHostEnvironment environment, ILoggerFactory factory) : base(options, environment, factory)
{
_loggingFields = options.CurrentValue.LoggingFields;
+ _additionalRequestHeaders = W3CLoggerOptions.FilterRequestHeaders(options.CurrentValue);
}
public override async Task OnFirstWrite(StreamWriter streamWriter, CancellationToken cancellationToken)
@@ -103,6 +105,14 @@ internal class W3CLoggerProcessor : FileLoggerProcessor
sb.Append(" cs(Referer)");
}
+ if (_additionalRequestHeaders != null)
+ {
+ foreach (var header in _additionalRequestHeaders)
+ {
+ sb.Append($" cs({header})");
+ }
+ }
+
return sb.ToString();
}
diff --git a/src/Middleware/HttpLogging/src/W3CLoggingMiddleware.cs b/src/Middleware/HttpLogging/src/W3CLoggingMiddleware.cs
index ad0133bfb0..e12d9ae7a0 100644
--- a/src/Middleware/HttpLogging/src/W3CLoggingMiddleware.cs
+++ b/src/Middleware/HttpLogging/src/W3CLoggingMiddleware.cs
@@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System.Globalization;
+using System.Linq;
using System.Numerics;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Internal;
@@ -38,6 +39,7 @@ internal sealed class W3CLoggingMiddleware
internal static readonly int _userAgentIndex = BitOperations.Log2((int)W3CLoggingFields.UserAgent);
internal static readonly int _cookieIndex = BitOperations.Log2((int)W3CLoggingFields.Cookie);
internal static readonly int _refererIndex = BitOperations.Log2((int)W3CLoggingFields.Referer);
+ private readonly ISet<string> _additionalRequestHeaders;
// Number of fields in W3CLoggingFields - equal to the number of _*Index variables above
internal const int _fieldsLength = 17;
@@ -68,6 +70,7 @@ internal sealed class W3CLoggingMiddleware
_next = next;
_options = options;
_w3cLogger = w3cLogger;
+ _additionalRequestHeaders = W3CLoggerOptions.FilterRequestHeaders(options.CurrentValue);
}
/// <summary>
@@ -79,7 +82,10 @@ internal sealed class W3CLoggingMiddleware
{
var options = _options.CurrentValue;
+ var additionalHeadersLength = _additionalRequestHeaders.Count;
+
var elements = new string[_fieldsLength];
+ var additionalHeaderElements = new string[additionalHeadersLength];
// Whether any of the requested fields actually had content
bool shouldLog = false;
@@ -181,6 +187,19 @@ internal sealed class W3CLoggingMiddleware
shouldLog |= AddToList(elements, _cookieIndex, cookie.ToString());
}
}
+
+ if (_additionalRequestHeaders.Count != 0)
+ {
+ var additionalRequestHeaders = _additionalRequestHeaders.ToList();
+
+ for (var i = 0; i < additionalHeadersLength; i++)
+ {
+ if (headers.TryGetValue(additionalRequestHeaders[i], out var headerValue))
+ {
+ shouldLog |= AddToList(additionalHeaderElements, i, headerValue.ToString());
+ }
+ }
+ }
}
}
@@ -195,7 +214,7 @@ internal sealed class W3CLoggingMiddleware
// Write the log
if (shouldLog)
{
- _w3cLogger.Log(elements);
+ _w3cLogger.Log(elements, additionalHeaderElements);
}
throw;
}
@@ -218,7 +237,7 @@ internal sealed class W3CLoggingMiddleware
// Write the log
if (shouldLog)
{
- _w3cLogger.Log(elements);
+ _w3cLogger.Log(elements, additionalHeaderElements);
}
}
diff --git a/src/Middleware/HttpLogging/test/FileLoggerProcessorTests.cs b/src/Middleware/HttpLogging/test/FileLoggerProcessorTests.cs
index 59811d02a0..d2f8916a55 100644
--- a/src/Middleware/HttpLogging/test/FileLoggerProcessorTests.cs
+++ b/src/Middleware/HttpLogging/test/FileLoggerProcessorTests.cs
@@ -479,8 +479,10 @@ public class FileLoggerProcessorTests
}
}
- [Fact]
- public async Task WritesToNewFileOnOptionsChange()
+ [Theory]
+ [InlineData(false, true)]
+ [InlineData(true, false)]
+ public async Task WritesToNewFileOnOptionsChange(bool fieldsChanged, bool headersChanged)
{
var mockSystemDateTime = new MockSystemDateTime
{
@@ -496,8 +498,9 @@ public class FileLoggerProcessorTests
{
LogDirectory = path,
LoggingFields = W3CLoggingFields.Time,
- FileSizeLimit = 10000
+ FileSizeLimit = 10000,
};
+ options.AdditionalRequestHeaders.Add("one");
var fileName1 = Path.Combine(path, FormattableString.Invariant($"{options.FileName}{_today.Year:0000}{_today.Month:00}{_today.Day:00}.0000.txt"));
var fileName2 = Path.Combine(path, FormattableString.Invariant($"{options.FileName}{_today.Year:0000}{_today.Month:00}{_today.Day:00}.0001.txt"));
var monitor = new OptionsWrapperMonitor<W3CLoggerOptions>(options);
@@ -507,7 +510,17 @@ public class FileLoggerProcessorTests
logger.SystemDateTime = mockSystemDateTime;
logger.EnqueueMessage(_messageOne);
await WaitForFile(fileName1, _messageOne.Length).DefaultTimeout();
- options.LoggingFields = W3CLoggingFields.Date;
+
+ if (fieldsChanged)
+ {
+ options.LoggingFields = W3CLoggingFields.Date;
+ }
+
+ if (headersChanged)
+ {
+ options.AdditionalRequestHeaders.Remove("one");
+ options.AdditionalRequestHeaders.Add("two");
+ }
monitor.InvokeChanged();
logger.EnqueueMessage(_messageTwo);
// Pause for a bit before disposing so logger can finish logging
diff --git a/src/Middleware/HttpLogging/test/W3CLoggerTests.cs b/src/Middleware/HttpLogging/test/W3CLoggerTests.cs
index d8d976caa3..c90b9557c7 100644
--- a/src/Middleware/HttpLogging/test/W3CLoggerTests.cs
+++ b/src/Middleware/HttpLogging/test/W3CLoggerTests.cs
@@ -27,10 +27,11 @@ public class W3CLoggerTests
await using (var logger = new TestW3CLogger(new OptionsWrapperMonitor<W3CLoggerOptions>(options), new HostingEnvironment(), NullLoggerFactory.Instance))
{
var elements = new string[W3CLoggingMiddleware._fieldsLength];
+ var additionalHeaders = new string[0];
AddToList(elements, W3CLoggingMiddleware._dateIndex, _timestampOne.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture));
AddToList(elements, W3CLoggingMiddleware._timeIndex, _timestampOne.ToString("HH:mm:ss", CultureInfo.InvariantCulture));
- logger.Log(elements);
+ logger.Log(elements, additionalHeaders);
await logger.Processor.WaitForWrites(4).DefaultTimeout();
var lines = logger.Processor.Lines;
@@ -69,11 +70,12 @@ public class W3CLoggerTests
await using (var logger = new TestW3CLogger(new OptionsWrapperMonitor<W3CLoggerOptions>(options), new HostingEnvironment(), NullLoggerFactory.Instance))
{
var elements = new string[W3CLoggingMiddleware._fieldsLength];
+ var additionalHeaders = new string[0];
AddToList(elements, W3CLoggingMiddleware._uriQueryIndex, null);
AddToList(elements, W3CLoggingMiddleware._hostIndex, null);
AddToList(elements, W3CLoggingMiddleware._protocolStatusIndex, null);
- logger.Log(elements);
+ logger.Log(elements, additionalHeaders);
await logger.Processor.WaitForWrites(4).DefaultTimeout();
var lines = logger.Processor.Lines;
diff --git a/src/Middleware/HttpLogging/test/W3CLoggingMiddlewareTests.cs b/src/Middleware/HttpLogging/test/W3CLoggingMiddlewareTests.cs
index 9876620112..d7073128fe 100644
--- a/src/Middleware/HttpLogging/test/W3CLoggingMiddlewareTests.cs
+++ b/src/Middleware/HttpLogging/test/W3CLoggingMiddlewareTests.cs
@@ -104,6 +104,107 @@ public class W3CLoggingMiddlewareTests
}
[Fact]
+ public async Task LogsAdditionalRequestHeaders()
+ {
+ var options = CreateOptionsAccessor();
+ options.CurrentValue.AdditionalRequestHeaders.Add("x-forwarded-for");
+ options.CurrentValue.AdditionalRequestHeaders.Add("x-client-ssl-protocol");
+ options.CurrentValue.AdditionalRequestHeaders.Add(":invalid");
+
+ var logger = new TestW3CLogger(options, new HostingEnvironment(), NullLoggerFactory.Instance);
+
+ var middleware = new W3CLoggingMiddleware(
+ c =>
+ {
+ c.Response.StatusCode = 200;
+ return Task.CompletedTask;
+ },
+ options,
+ logger);
+
+ options.CurrentValue.AdditionalRequestHeaders.Add("ignored-header-added-after-clone");
+
+ var httpContext = new DefaultHttpContext();
+ httpContext.Request.Protocol = "HTTP/1.0";
+ httpContext.Request.Headers["Cookie"] = "Snickerdoodle";
+ httpContext.Request.Headers["x-forwarded-for"] = "1.3.3.7, 2001:db8:85a3:8d3:1319:8a2e:370:7348";
+ httpContext.Response.StatusCode = 200;
+
+ var now = DateTime.UtcNow;
+ await middleware.Invoke(httpContext);
+ await logger.Processor.WaitForWrites(4).DefaultTimeout();
+
+ var lines = logger.Processor.Lines;
+ Assert.Equal("#Version: 1.0", lines[0]);
+
+ Assert.StartsWith("#Start-Date: ", lines[1]);
+ var startDate = DateTime.Parse(lines[1].Substring(13), CultureInfo.InvariantCulture);
+ // Assert that the log was written in the last 10 seconds
+ // W3CLogger writes start-time to second precision, so delta could be as low as -0.999...
+ var delta = startDate.Subtract(now).TotalSeconds;
+ Assert.InRange(delta, -1, 10);
+
+ Assert.Equal("#Fields: date time c-ip s-computername s-ip s-port cs-method cs-uri-stem cs-uri-query sc-status time-taken cs-version cs-host cs(User-Agent) cs(Referer) cs(:invalid) cs(x-client-ssl-protocol) cs(x-forwarded-for)", lines[2]);
+ Assert.DoesNotContain("Snickerdoodle", lines[3]);
+ Assert.EndsWith("- - 1.3.3.7,+2001:db8:85a3:8d3:1319:8a2e:370:7348", lines[3]);
+ }
+
+ [Fact]
+ public async Task OmitsDuplicateAdditionalRequestHeaders()
+ {
+ var options = CreateOptionsAccessor();
+ options.CurrentValue.LoggingFields = options.CurrentValue.LoggingFields | W3CLoggingFields.Host |
+ W3CLoggingFields.Referer | W3CLoggingFields.UserAgent |
+ W3CLoggingFields.Cookie;
+
+ options.CurrentValue.AdditionalRequestHeaders.Add(":invalid");
+ options.CurrentValue.AdditionalRequestHeaders.Add("x-forwarded-for");
+ options.CurrentValue.AdditionalRequestHeaders.Add("Host");
+ options.CurrentValue.AdditionalRequestHeaders.Add("Referer");
+ options.CurrentValue.AdditionalRequestHeaders.Add("User-Agent");
+ options.CurrentValue.AdditionalRequestHeaders.Add("Cookie");
+ options.CurrentValue.AdditionalRequestHeaders.Add("x-client-ssl-protocol");
+
+ var logger = new TestW3CLogger(options, new HostingEnvironment(), NullLoggerFactory.Instance);
+
+ var middleware = new W3CLoggingMiddleware(
+ c =>
+ {
+ c.Response.StatusCode = 200;
+ return Task.CompletedTask;
+ },
+ options,
+ logger);
+
+ options.CurrentValue.AdditionalRequestHeaders.Add("ignored-header-added-after-clone");
+
+ var httpContext = new DefaultHttpContext();
+ httpContext.Request.Protocol = "HTTP/1.0";
+ httpContext.Request.Headers["Cookie"] = "Snickerdoodle";
+ httpContext.Request.Headers["x-forwarded-for"] = "1.3.3.7, 2001:db8:85a3:8d3:1319:8a2e:370:7348";
+ httpContext.Response.StatusCode = 200;
+
+ var now = DateTime.UtcNow;
+ await middleware.Invoke(httpContext);
+ await logger.Processor.WaitForWrites(4).DefaultTimeout();
+
+ var lines = logger.Processor.Lines;
+ Assert.Equal("#Version: 1.0", lines[0]);
+
+ Assert.StartsWith("#Start-Date: ", lines[1]);
+ var startDate = DateTime.Parse(lines[1].Substring(13), CultureInfo.InvariantCulture);
+ // Assert that the log was written in the last 10 seconds
+ // W3CLogger writes start-time to second precision, so delta could be as low as -0.999...
+ var delta = startDate.Subtract(now).TotalSeconds;
+ Assert.InRange(delta, -1, 10);
+
+ Assert.Equal("#Fields: date time c-ip s-computername s-ip s-port cs-method cs-uri-stem cs-uri-query sc-status time-taken cs-version cs-host cs(User-Agent) cs(Cookie) cs(Referer) cs(:invalid) cs(x-client-ssl-protocol) cs(x-forwarded-for)", lines[2]);
+ Assert.Equal(19, lines[3].Split(' ').Length);
+ Assert.Contains("Snickerdoodle", lines[3]);
+ Assert.Contains("- - 1.3.3.7,+2001:db8:85a3:8d3:1319:8a2e:370:7348", lines[3]);
+ }
+
+ [Fact]
public async Task TimeTakenIsInMilliseconds()
{
var options = CreateOptionsAccessor();
diff --git a/src/Middleware/Middleware.slnf b/src/Middleware/Middleware.slnf
index 2321ac94ea..6033a2555e 100644
--- a/src/Middleware/Middleware.slnf
+++ b/src/Middleware/Middleware.slnf
@@ -78,6 +78,10 @@
"src\\Middleware\\MiddlewareAnalysis\\test\\Microsoft.AspNetCore.MiddlewareAnalysis.Tests.csproj",
"src\\Middleware\\RateLimiting\\src\\Microsoft.AspNetCore.RateLimiting.csproj",
"src\\Middleware\\RateLimiting\\test\\Microsoft.AspNetCore.RateLimiting.Tests.csproj",
+ "src\\Middleware\\RequestDecompression\\perf\\Microbenchmarks\\Microsoft.AspNetCore.RequestDecompression.Microbenchmarks.csproj",
+ "src\\Middleware\\RequestDecompression\\sample\\RequestDecompressionSample.csproj",
+ "src\\Middleware\\RequestDecompression\\src\\Microsoft.AspNetCore.RequestDecompression.csproj",
+ "src\\Middleware\\RequestDecompression\\test\\Microsoft.AspNetCore.RequestDecompression.Tests.csproj",
"src\\Middleware\\ResponseCaching.Abstractions\\src\\Microsoft.AspNetCore.ResponseCaching.Abstractions.csproj",
"src\\Middleware\\ResponseCaching\\samples\\ResponseCachingSample\\ResponseCachingSample.csproj",
"src\\Middleware\\ResponseCaching\\src\\Microsoft.AspNetCore.ResponseCaching.csproj",
@@ -117,4 +121,4 @@
"src\\Servers\\Kestrel\\Transport.Sockets\\src\\Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.csproj"
]
}
-}
+} \ No newline at end of file
diff --git a/src/Middleware/RequestDecompression/perf/Microbenchmarks/AssemblyInfo.cs b/src/Middleware/RequestDecompression/perf/Microbenchmarks/AssemblyInfo.cs
new file mode 100644
index 0000000000..09f49228e9
--- /dev/null
+++ b/src/Middleware/RequestDecompression/perf/Microbenchmarks/AssemblyInfo.cs
@@ -0,0 +1,4 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+[assembly: BenchmarkDotNet.Attributes.AspNetCoreBenchmark]
diff --git a/src/Middleware/RequestDecompression/perf/Microbenchmarks/Microsoft.AspNetCore.RequestDecompression.Microbenchmarks.csproj b/src/Middleware/RequestDecompression/perf/Microbenchmarks/Microsoft.AspNetCore.RequestDecompression.Microbenchmarks.csproj
new file mode 100644
index 0000000000..f40a518712
--- /dev/null
+++ b/src/Middleware/RequestDecompression/perf/Microbenchmarks/Microsoft.AspNetCore.RequestDecompression.Microbenchmarks.csproj
@@ -0,0 +1,15 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <OutputType>Exe</OutputType>
+ <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <Reference Include="BenchmarkDotNet" />
+ <Reference Include="Microsoft.AspNetCore.RequestDecompression" />
+
+ <Compile Include="$(SharedSourceRoot)BenchmarkRunner\*.cs" />
+ </ItemGroup>
+
+</Project>
diff --git a/src/Middleware/RequestDecompression/perf/Microbenchmarks/RequestDecompressionMiddlewareBenchmark.cs b/src/Middleware/RequestDecompression/perf/Microbenchmarks/RequestDecompressionMiddlewareBenchmark.cs
new file mode 100644
index 0000000000..b788389859
--- /dev/null
+++ b/src/Middleware/RequestDecompression/perf/Microbenchmarks/RequestDecompressionMiddlewareBenchmark.cs
@@ -0,0 +1,92 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using BenchmarkDotNet.Attributes;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Http.Features;
+using Microsoft.AspNetCore.Http.Metadata;
+using Microsoft.Extensions.Logging.Abstractions;
+using Microsoft.Extensions.Options;
+
+namespace Microsoft.AspNetCore.RequestDecompression.Benchmarks;
+
+public class RequestDecompressionMiddlewareBenchmark
+{
+ private RequestDecompressionMiddleware _middleware;
+
+ [GlobalSetup]
+ public void GlobalSetup()
+ {
+ var requestDecompressionProvider = new DefaultRequestDecompressionProvider(
+ NullLogger<DefaultRequestDecompressionProvider>.Instance,
+ Options.Create(new RequestDecompressionOptions())
+ );
+
+ _middleware = new RequestDecompressionMiddleware(
+ context => Task.CompletedTask,
+ NullLogger<RequestDecompressionMiddleware>.Instance,
+ requestDecompressionProvider
+ );
+ }
+
+ [Params(true, false)]
+ public bool HasRequestSizeLimitMetadata { get; set; }
+
+ [Benchmark]
+ public async Task HandleRequest_Compressed()
+ {
+ var context = CreateHttpContext(HasRequestSizeLimitMetadata);
+
+ context.Request.Headers.ContentEncoding = "gzip";
+
+ await _middleware.Invoke(context);
+ }
+
+ [Benchmark]
+ public async Task HandleRequest_Uncompressed()
+ {
+ var context = CreateHttpContext(HasRequestSizeLimitMetadata);
+
+ await _middleware.Invoke(context);
+ }
+
+ private static DefaultHttpContext CreateHttpContext(bool hasRequestSizeLimitMetadata)
+ {
+ var features = new FeatureCollection();
+ features.Set<IHttpRequestFeature>(new HttpRequestFeature());
+ features.Set<IHttpResponseFeature>(new HttpResponseFeature());
+ features.Set<IHttpMaxRequestBodySizeFeature>(new MaxRequestBodySizeFeature());
+ features.Set<IEndpointFeature>(new EndpointFeature(hasRequestSizeLimitMetadata));
+ var context = new DefaultHttpContext(features);
+ return context;
+ }
+
+ private sealed class MaxRequestBodySizeFeature : IHttpMaxRequestBodySizeFeature
+ {
+ public bool IsReadOnly => false;
+
+ public long? MaxRequestBodySize { get; set; } = 30_000_000;
+ }
+
+ private sealed class EndpointFeature : IEndpointFeature
+ {
+ public Endpoint Endpoint { get; set; }
+
+ public EndpointFeature(bool hasRequestSizeLimitMetadata)
+ {
+ var metadataCollection = hasRequestSizeLimitMetadata
+ ? new EndpointMetadataCollection(new SizeLimitMetadata())
+ : new EndpointMetadataCollection();
+
+ Endpoint = new Endpoint(
+ requestDelegate: null,
+ metadata: metadataCollection,
+ displayName: null);
+ }
+ }
+
+ private sealed class SizeLimitMetadata : IRequestSizeLimitMetadata
+ {
+ public long? MaxRequestBodySize { get; set; } = 50_000_000;
+ }
+}
diff --git a/src/Middleware/RequestDecompression/sample/CustomDecompressionProvider.cs b/src/Middleware/RequestDecompression/sample/CustomDecompressionProvider.cs
new file mode 100644
index 0000000000..9bfa11acf2
--- /dev/null
+++ b/src/Middleware/RequestDecompression/sample/CustomDecompressionProvider.cs
@@ -0,0 +1,15 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using Microsoft.AspNetCore.RequestDecompression;
+
+namespace RequestDecompressionSample;
+
+public class CustomDecompressionProvider : IDecompressionProvider
+{
+ public Stream GetDecompressionStream(Stream stream)
+ {
+ // Create a custom decompression stream wrapper here.
+ return stream;
+ }
+}
diff --git a/src/Middleware/RequestDecompression/sample/Properties/launchsettings.json b/src/Middleware/RequestDecompression/sample/Properties/launchsettings.json
new file mode 100644
index 0000000000..26a370a87f
--- /dev/null
+++ b/src/Middleware/RequestDecompression/sample/Properties/launchsettings.json
@@ -0,0 +1,27 @@
+{
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:6164/",
+ "sslPort": 0
+ }
+ },
+ "profiles": {
+ "RequestDecompressionSample": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "launchUrl": "http://localhost:5000/",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+ }
diff --git a/src/Middleware/RequestDecompression/sample/RequestDecompressionSample.csproj b/src/Middleware/RequestDecompression/sample/RequestDecompressionSample.csproj
new file mode 100644
index 0000000000..fec9ada308
--- /dev/null
+++ b/src/Middleware/RequestDecompression/sample/RequestDecompressionSample.csproj
@@ -0,0 +1,13 @@
+<Project Sdk="Microsoft.NET.Sdk.Web">
+
+ <PropertyGroup>
+ <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <Reference Include="Microsoft.AspNetCore.RequestDecompression" />
+ <Reference Include="Microsoft.AspNetCore.Server.Kestrel" />
+ <Reference Include="Microsoft.Extensions.Logging.Console" />
+ </ItemGroup>
+
+</Project> \ No newline at end of file
diff --git a/src/Middleware/RequestDecompression/sample/Startup.cs b/src/Middleware/RequestDecompression/sample/Startup.cs
new file mode 100644
index 0000000000..55d99ab8ec
--- /dev/null
+++ b/src/Middleware/RequestDecompression/sample/Startup.cs
@@ -0,0 +1,48 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace RequestDecompressionSample;
+
+public class Startup
+{
+ public void ConfigureServices(IServiceCollection services)
+ {
+ services.AddRequestDecompression(options =>
+ {
+ options.DecompressionProviders.Add("custom", new CustomDecompressionProvider());
+ });
+ }
+
+ public void Configure(IApplicationBuilder app)
+ {
+ app.UseRequestDecompression();
+ app.Map("/test", testApp =>
+ {
+ testApp.Run(async context =>
+ {
+ using var reader = new StreamReader(context.Request.Body);
+ var decompressedBody = await reader.ReadToEndAsync(context.RequestAborted);
+
+ await context.Response.WriteAsync(decompressedBody, context.RequestAborted);
+ });
+ });
+ }
+
+ public static Task Main(string[] args)
+ {
+ var host = new HostBuilder()
+ .ConfigureWebHost(webHostBuilder =>
+ {
+ webHostBuilder
+ .UseKestrel()
+ .ConfigureLogging(factory =>
+ {
+ factory.AddConsole()
+ .SetMinimumLevel(LogLevel.Debug);
+ })
+ .UseStartup<Startup>();
+ }).Build();
+
+ return host.RunAsync();
+ }
+}
diff --git a/src/Middleware/RequestDecompression/src/BrotliDecompressionProvider.cs b/src/Middleware/RequestDecompression/src/BrotliDecompressionProvider.cs
new file mode 100644
index 0000000000..7b3b28837f
--- /dev/null
+++ b/src/Middleware/RequestDecompression/src/BrotliDecompressionProvider.cs
@@ -0,0 +1,18 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System.IO.Compression;
+
+namespace Microsoft.AspNetCore.RequestDecompression;
+
+/// <summary>
+/// Brotli decompression provider.
+/// </summary>
+internal sealed class BrotliDecompressionProvider : IDecompressionProvider
+{
+ /// <inheritdoc />
+ public Stream GetDecompressionStream(Stream stream)
+ {
+ return new BrotliStream(stream, CompressionMode.Decompress, leaveOpen: true);
+ }
+}
diff --git a/src/Middleware/RequestDecompression/src/DefaultRequestDecompressionProvider.cs b/src/Middleware/RequestDecompression/src/DefaultRequestDecompressionProvider.cs
new file mode 100644
index 0000000000..3178fcc5d2
--- /dev/null
+++ b/src/Middleware/RequestDecompression/src/DefaultRequestDecompressionProvider.cs
@@ -0,0 +1,90 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using Microsoft.AspNetCore.Http;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Options;
+using Microsoft.Extensions.Primitives;
+using Microsoft.Net.Http.Headers;
+
+namespace Microsoft.AspNetCore.RequestDecompression;
+
+/// <inheritdoc />
+internal sealed partial class DefaultRequestDecompressionProvider : IRequestDecompressionProvider
+{
+ private readonly ILogger _logger;
+ private readonly IDictionary<string, IDecompressionProvider> _providers;
+
+ public DefaultRequestDecompressionProvider(
+ ILogger<DefaultRequestDecompressionProvider> logger,
+ IOptions<RequestDecompressionOptions> options)
+ {
+ if (logger is null)
+ {
+ throw new ArgumentNullException(nameof(logger));
+ }
+
+ if (options is null)
+ {
+ throw new ArgumentNullException(nameof(options));
+ }
+
+ _logger = logger;
+ _providers = options.Value.DecompressionProviders;
+ }
+
+ /// <inheritdoc />
+ public Stream? GetDecompressionStream(HttpContext context)
+ {
+ var encodings = context.Request.Headers.ContentEncoding;
+
+ if (StringValues.IsNullOrEmpty(encodings))
+ {
+ Log.NoContentEncoding(_logger);
+ return null;
+ }
+
+ if (encodings.Count > 1)
+ {
+ Log.MultipleContentEncodingsSpecified(_logger);
+ return null;
+ }
+
+ string encodingName = encodings!;
+
+ if (_providers.TryGetValue(encodingName, out var matchingProvider))
+ {
+ Log.DecompressingWith(_logger, encodingName);
+
+ context.Request.Headers.Remove(HeaderNames.ContentEncoding);
+
+ return matchingProvider.GetDecompressionStream(context.Request.Body);
+ }
+
+ Log.NoDecompressionProvider(_logger);
+ return null;
+ }
+
+ private static partial class Log
+ {
+ [LoggerMessage(1, LogLevel.Trace, "The Content-Encoding header is empty or not specified. Skipping request decompression.", EventName = "NoContentEncoding")]
+ public static partial void NoContentEncoding(ILogger logger);
+
+ [LoggerMessage(2, LogLevel.Debug, "Request decompression is not supported for multiple Content-Encodings.", EventName = "MultipleContentEncodingsSpecified")]
+ public static partial void MultipleContentEncodingsSpecified(ILogger logger);
+
+ [LoggerMessage(3, LogLevel.Debug, "No matching request decompression provider found.", EventName = "NoDecompressionProvider")]
+ public static partial void NoDecompressionProvider(ILogger logger);
+
+ public static void DecompressingWith(ILogger logger, string contentEncoding)
+ {
+ if (logger.IsEnabled(LogLevel.Debug))
+ {
+ DecompressingWithCore(logger, contentEncoding.ToLowerInvariant());
+ }
+ }
+
+ [LoggerMessage(4, LogLevel.Debug, "The request will be decompressed with '{ContentEncoding}'.", EventName = "DecompressingWith", SkipEnabledCheck = true)]
+ private static partial void DecompressingWithCore(ILogger logger, string contentEncoding);
+ }
+}
diff --git a/src/Middleware/RequestDecompression/src/DeflateDecompressionProvider.cs b/src/Middleware/RequestDecompression/src/DeflateDecompressionProvider.cs
new file mode 100644
index 0000000000..6291f15b2d
--- /dev/null
+++ b/src/Middleware/RequestDecompression/src/DeflateDecompressionProvider.cs
@@ -0,0 +1,18 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System.IO.Compression;
+
+namespace Microsoft.AspNetCore.RequestDecompression;
+
+/// <summary>
+/// DEFLATE decompression provider.
+/// </summary>
+internal sealed class DeflateDecompressionProvider : IDecompressionProvider
+{
+ /// <inheritdoc />
+ public Stream GetDecompressionStream(Stream stream)
+ {
+ return new DeflateStream(stream, CompressionMode.Decompress, leaveOpen: true);
+ }
+}
diff --git a/src/Middleware/RequestDecompression/src/GZipDecompressionProvider.cs b/src/Middleware/RequestDecompression/src/GZipDecompressionProvider.cs
new file mode 100644
index 0000000000..74ac6835f8
--- /dev/null
+++ b/src/Middleware/RequestDecompression/src/GZipDecompressionProvider.cs
@@ -0,0 +1,18 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System.IO.Compression;
+
+namespace Microsoft.AspNetCore.RequestDecompression;
+
+/// <summary>
+/// GZip decompression provider.
+/// </summary>
+internal sealed class GZipDecompressionProvider : IDecompressionProvider
+{
+ /// <inheritdoc />
+ public Stream GetDecompressionStream(Stream stream)
+ {
+ return new GZipStream(stream, CompressionMode.Decompress, leaveOpen: true);
+ }
+}
diff --git a/src/Middleware/RequestDecompression/src/IDecompressionProvider.cs b/src/Middleware/RequestDecompression/src/IDecompressionProvider.cs
new file mode 100644
index 0000000000..f59be0fe87
--- /dev/null
+++ b/src/Middleware/RequestDecompression/src/IDecompressionProvider.cs
@@ -0,0 +1,17 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace Microsoft.AspNetCore.RequestDecompression;
+
+/// <summary>
+/// Provides a specific decompression implementation to decompress HTTP request bodies.
+/// </summary>
+public interface IDecompressionProvider
+{
+ /// <summary>
+ /// Creates a new decompression stream.
+ /// </summary>
+ /// <param name="stream">The compressed request body stream.</param>
+ /// <returns>The decompression stream.</returns>
+ Stream GetDecompressionStream(Stream stream);
+}
diff --git a/src/Middleware/RequestDecompression/src/IRequestDecompressionProvider.cs b/src/Middleware/RequestDecompression/src/IRequestDecompressionProvider.cs
new file mode 100644
index 0000000000..6387b91a30
--- /dev/null
+++ b/src/Middleware/RequestDecompression/src/IRequestDecompressionProvider.cs
@@ -0,0 +1,19 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using Microsoft.AspNetCore.Http;
+
+namespace Microsoft.AspNetCore.RequestDecompression;
+
+/// <summary>
+/// Used to examine requests to see if decompression should be used.
+/// </summary>
+public interface IRequestDecompressionProvider
+{
+ /// <summary>
+ /// Examines the request and selects an acceptable decompression provider, if any.
+ /// </summary>
+ /// <param name="context">The <see cref="HttpContext"/>.</param>
+ /// <returns>The decompression stream when the provider is capable of decompressing the HTTP request body, otherwise <see langword="null" />.</returns>
+ Stream? GetDecompressionStream(HttpContext context);
+}
diff --git a/src/Middleware/RequestDecompression/src/Microsoft.AspNetCore.RequestDecompression.csproj b/src/Middleware/RequestDecompression/src/Microsoft.AspNetCore.RequestDecompression.csproj
new file mode 100644
index 0000000000..3089a5ca16
--- /dev/null
+++ b/src/Middleware/RequestDecompression/src/Microsoft.AspNetCore.RequestDecompression.csproj
@@ -0,0 +1,24 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <Description>ASP.NET Core middleware for HTTP Request decompression.</Description>
+ <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
+ <IsAspNetCoreApp>true</IsAspNetCoreApp>
+ <GenerateDocumentationFile>true</GenerateDocumentationFile>
+ <PackageTags>aspnetcore</PackageTags>
+ <IsPackable>false</IsPackable>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <Reference Include="Microsoft.AspNetCore.Http" />
+ <Reference Include="Microsoft.AspNetCore.Http.Extensions" />
+ <Reference Include="Microsoft.Extensions.Logging.Abstractions" />
+ <Reference Include="Microsoft.Extensions.Options" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <InternalsVisibleTo Include="Microsoft.AspNetCore.RequestDecompression.Tests" />
+ <InternalsVisibleTo Include="Microsoft.AspNetCore.RequestDecompression.Microbenchmarks" />
+ </ItemGroup>
+
+</Project> \ No newline at end of file
diff --git a/src/Middleware/RequestDecompression/src/PublicAPI.Shipped.txt b/src/Middleware/RequestDecompression/src/PublicAPI.Shipped.txt
new file mode 100644
index 0000000000..ab058de62d
--- /dev/null
+++ b/src/Middleware/RequestDecompression/src/PublicAPI.Shipped.txt
@@ -0,0 +1 @@
+#nullable enable
diff --git a/src/Middleware/RequestDecompression/src/PublicAPI.Unshipped.txt b/src/Middleware/RequestDecompression/src/PublicAPI.Unshipped.txt
new file mode 100644
index 0000000000..14f9b5dc49
--- /dev/null
+++ b/src/Middleware/RequestDecompression/src/PublicAPI.Unshipped.txt
@@ -0,0 +1,13 @@
+#nullable enable
+Microsoft.AspNetCore.Builder.RequestDecompressionBuilderExtensions
+Microsoft.AspNetCore.RequestDecompression.IDecompressionProvider
+Microsoft.AspNetCore.RequestDecompression.IDecompressionProvider.GetDecompressionStream(System.IO.Stream! stream) -> System.IO.Stream!
+Microsoft.AspNetCore.RequestDecompression.IRequestDecompressionProvider
+Microsoft.AspNetCore.RequestDecompression.IRequestDecompressionProvider.GetDecompressionStream(Microsoft.AspNetCore.Http.HttpContext! context) -> System.IO.Stream?
+Microsoft.AspNetCore.RequestDecompression.RequestDecompressionOptions
+Microsoft.AspNetCore.RequestDecompression.RequestDecompressionOptions.DecompressionProviders.get -> System.Collections.Generic.IDictionary<string!, Microsoft.AspNetCore.RequestDecompression.IDecompressionProvider!>!
+Microsoft.AspNetCore.RequestDecompression.RequestDecompressionOptions.RequestDecompressionOptions() -> void
+Microsoft.Extensions.DependencyInjection.RequestDecompressionServiceExtensions
+static Microsoft.AspNetCore.Builder.RequestDecompressionBuilderExtensions.UseRequestDecompression(this Microsoft.AspNetCore.Builder.IApplicationBuilder! builder) -> Microsoft.AspNetCore.Builder.IApplicationBuilder!
+static Microsoft.Extensions.DependencyInjection.RequestDecompressionServiceExtensions.AddRequestDecompression(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
+static Microsoft.Extensions.DependencyInjection.RequestDecompressionServiceExtensions.AddRequestDecompression(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services, System.Action<Microsoft.AspNetCore.RequestDecompression.RequestDecompressionOptions!>! configureOptions) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
diff --git a/src/Middleware/RequestDecompression/src/RequestDecompressionBuilderExtensions.cs b/src/Middleware/RequestDecompression/src/RequestDecompressionBuilderExtensions.cs
new file mode 100644
index 0000000000..c67d2bdfd1
--- /dev/null
+++ b/src/Middleware/RequestDecompression/src/RequestDecompressionBuilderExtensions.cs
@@ -0,0 +1,26 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using Microsoft.AspNetCore.RequestDecompression;
+
+namespace Microsoft.AspNetCore.Builder;
+
+/// <summary>
+/// Extension methods for the HTTP request decompression middleware.
+/// </summary>
+public static class RequestDecompressionBuilderExtensions
+{
+ /// <summary>
+ /// Adds middleware for dynamically decompressing HTTP request bodies.
+ /// </summary>
+ /// <param name="builder">The <see cref="IApplicationBuilder"/> instance this method extends.</param>
+ public static IApplicationBuilder UseRequestDecompression(this IApplicationBuilder builder)
+ {
+ if (builder is null)
+ {
+ throw new ArgumentNullException(nameof(builder));
+ }
+
+ return builder.UseMiddleware<RequestDecompressionMiddleware>();
+ }
+}
diff --git a/src/Middleware/RequestDecompression/src/RequestDecompressionMiddleware.cs b/src/Middleware/RequestDecompression/src/RequestDecompressionMiddleware.cs
new file mode 100644
index 0000000000..253b1d2388
--- /dev/null
+++ b/src/Middleware/RequestDecompression/src/RequestDecompressionMiddleware.cs
@@ -0,0 +1,141 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System.Globalization;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Http.Features;
+using Microsoft.AspNetCore.Http.Metadata;
+using Microsoft.Extensions.Logging;
+
+namespace Microsoft.AspNetCore.RequestDecompression;
+
+/// <summary>
+/// Enables HTTP request decompression.
+/// </summary>
+internal sealed partial class RequestDecompressionMiddleware
+{
+ private readonly RequestDelegate _next;
+ private readonly ILogger<RequestDecompressionMiddleware> _logger;
+ private readonly IRequestDecompressionProvider _provider;
+
+ /// <summary>
+ /// Initialize the request decompression middleware.
+ /// </summary>
+ /// <param name="next">The delegate representing the remaining middleware in the request pipeline.</param>
+ /// <param name="logger">The logger.</param>
+ /// <param name="provider">The <see cref="IRequestDecompressionProvider"/>.</param>
+ public RequestDecompressionMiddleware(
+ RequestDelegate next,
+ ILogger<RequestDecompressionMiddleware> logger,
+ IRequestDecompressionProvider provider)
+ {
+ if (next is null)
+ {
+ throw new ArgumentNullException(nameof(next));
+ }
+
+ if (logger is null)
+ {
+ throw new ArgumentNullException(nameof(logger));
+ }
+
+ if (provider is null)
+ {
+ throw new ArgumentNullException(nameof(provider));
+ }
+
+ _next = next;
+ _logger = logger;
+ _provider = provider;
+ }
+
+ /// <summary>
+ /// Invoke the middleware.
+ /// </summary>
+ /// <param name="context">The <see cref="HttpContext"/>.</param>
+ /// <returns>A task that represents the execution of this middleware.</returns>
+ public Task Invoke(HttpContext context)
+ {
+ SetMaxRequestBodySize(context);
+
+ var decompressionStream = _provider.GetDecompressionStream(context);
+ if (decompressionStream is null)
+ {
+ return _next(context);
+ }
+
+ return InvokeCore(context, decompressionStream);
+ }
+
+ private async Task InvokeCore(HttpContext context, Stream decompressionStream)
+ {
+ var request = context.Request.Body;
+ try
+ {
+ var sizeLimit =
+ context.GetEndpoint()?.Metadata?.GetMetadata<IRequestSizeLimitMetadata>()?.MaxRequestBodySize
+ ?? context.Features.Get<IHttpMaxRequestBodySizeFeature>()?.MaxRequestBodySize;
+
+ context.Request.Body = new SizeLimitedStream(decompressionStream, sizeLimit);
+ await _next(context);
+ }
+ finally
+ {
+ context.Request.Body = request;
+ await decompressionStream.DisposeAsync();
+ }
+ }
+
+ private void SetMaxRequestBodySize(HttpContext context)
+ {
+ var sizeLimitMetadata = context.GetEndpoint()?.Metadata?.GetMetadata<IRequestSizeLimitMetadata>();
+ if (sizeLimitMetadata == null)
+ {
+ Log.MetadataNotFound(_logger);
+ return;
+ }
+
+ var maxRequestBodySizeFeature = context.Features.Get<IHttpMaxRequestBodySizeFeature>();
+ if (maxRequestBodySizeFeature == null)
+ {
+ Log.FeatureNotFound(_logger);
+ }
+ else if (maxRequestBodySizeFeature.IsReadOnly)
+ {
+ Log.FeatureIsReadOnly(_logger);
+ }
+ else
+ {
+ var maxRequestBodySize = sizeLimitMetadata.MaxRequestBodySize;
+ maxRequestBodySizeFeature.MaxRequestBodySize = maxRequestBodySize;
+
+ if (maxRequestBodySize.HasValue)
+ {
+ Log.MaxRequestBodySizeSet(_logger,
+ maxRequestBodySize.Value.ToString(CultureInfo.InvariantCulture));
+ }
+ else
+ {
+ Log.MaxRequestBodySizeDisabled(_logger);
+ }
+ }
+ }
+
+ private static partial class Log
+ {
+ [LoggerMessage(1, LogLevel.Debug, $"The endpoint does not specify the {nameof(IRequestSizeLimitMetadata)}.", EventName = "MetadataNotFound")]
+ public static partial void MetadataNotFound(ILogger logger);
+
+ [LoggerMessage(2, LogLevel.Warning, $"A request body size limit could not be applied. This server does not support the {nameof(IHttpMaxRequestBodySizeFeature)}.", EventName = "FeatureNotFound")]
+ public static partial void FeatureNotFound(ILogger logger);
+
+ [LoggerMessage(3, LogLevel.Warning, $"A request body size limit could not be applied. The {nameof(IHttpMaxRequestBodySizeFeature)} for the server is read-only.", EventName = "FeatureIsReadOnly")]
+ public static partial void FeatureIsReadOnly(ILogger logger);
+
+ [LoggerMessage(4, LogLevel.Debug, "The maximum request body size has been set to {RequestSize}.", EventName = "MaxRequestBodySizeSet")]
+ public static partial void MaxRequestBodySizeSet(ILogger logger, string requestSize);
+
+ [LoggerMessage(5, LogLevel.Debug, "The maximum request body size as been disabled.", EventName = "MaxRequestBodySizeDisabled")]
+ public static partial void MaxRequestBodySizeDisabled(ILogger logger);
+ }
+}
diff --git a/src/Middleware/RequestDecompression/src/RequestDecompressionOptions.cs b/src/Middleware/RequestDecompression/src/RequestDecompressionOptions.cs
new file mode 100644
index 0000000000..b6821e9046
--- /dev/null
+++ b/src/Middleware/RequestDecompression/src/RequestDecompressionOptions.cs
@@ -0,0 +1,20 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace Microsoft.AspNetCore.RequestDecompression;
+
+/// <summary>
+/// Options for the HTTP request decompression middleware.
+/// </summary>
+public sealed class RequestDecompressionOptions
+{
+ /// <summary>
+ /// The <see cref="IDecompressionProvider"/> types to use for request decompression.
+ /// </summary>
+ public IDictionary<string, IDecompressionProvider> DecompressionProviders { get; } = new Dictionary<string, IDecompressionProvider>(StringComparer.OrdinalIgnoreCase)
+ {
+ ["br"] = new BrotliDecompressionProvider(),
+ ["deflate"] = new DeflateDecompressionProvider(),
+ ["gzip"] = new GZipDecompressionProvider()
+ };
+}
diff --git a/src/Middleware/RequestDecompression/src/RequestDecompressionServiceExtensions.cs b/src/Middleware/RequestDecompression/src/RequestDecompressionServiceExtensions.cs
new file mode 100644
index 0000000000..7996ef88a9
--- /dev/null
+++ b/src/Middleware/RequestDecompression/src/RequestDecompressionServiceExtensions.cs
@@ -0,0 +1,52 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using Microsoft.AspNetCore.RequestDecompression;
+using Microsoft.Extensions.DependencyInjection.Extensions;
+
+namespace Microsoft.Extensions.DependencyInjection;
+
+/// <summary>
+/// Extension methods for the HTTP request decompression middleware.
+/// </summary>
+public static class RequestDecompressionServiceExtensions
+{
+ /// <summary>
+ /// Add request decompression services.
+ /// </summary>
+ /// <param name="services">The <see cref="IServiceCollection"/> for adding services.</param>
+ /// <returns>The <see cref="IServiceCollection"/>.</returns>
+ public static IServiceCollection AddRequestDecompression(this IServiceCollection services)
+ {
+ if (services is null)
+ {
+ throw new ArgumentNullException(nameof(services));
+ }
+
+ services.TryAddSingleton<IRequestDecompressionProvider, DefaultRequestDecompressionProvider>();
+ return services;
+ }
+
+ /// <summary>
+ /// Add request decompression services and configure the related options.
+ /// </summary>
+ /// <param name="services">The <see cref="IServiceCollection"/> for adding services.</param>
+ /// <param name="configureOptions">A delegate to configure the <see cref="RequestDecompressionOptions"/>.</param>
+ /// <returns>The <see cref="IServiceCollection"/>.</returns>
+ public static IServiceCollection AddRequestDecompression(this IServiceCollection services, Action<RequestDecompressionOptions> configureOptions)
+ {
+ if (services is null)
+ {
+ throw new ArgumentNullException(nameof(services));
+ }
+
+ if (configureOptions is null)
+ {
+ throw new ArgumentNullException(nameof(configureOptions));
+ }
+
+ services.Configure(configureOptions);
+ services.TryAddSingleton<IRequestDecompressionProvider, DefaultRequestDecompressionProvider>();
+ return services;
+ }
+}
diff --git a/src/Middleware/RequestDecompression/src/SizeLimitedStream.cs b/src/Middleware/RequestDecompression/src/SizeLimitedStream.cs
new file mode 100644
index 0000000000..2c53bd7307
--- /dev/null
+++ b/src/Middleware/RequestDecompression/src/SizeLimitedStream.cs
@@ -0,0 +1,94 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace Microsoft.AspNetCore.RequestDecompression;
+
+internal sealed class SizeLimitedStream : Stream
+{
+ private readonly Stream _innerStream;
+ private readonly long? _sizeLimit;
+
+ private long _totalBytesRead;
+
+ public SizeLimitedStream(Stream innerStream, long? sizeLimit)
+ {
+ if (innerStream is null)
+ {
+ throw new ArgumentNullException(nameof(innerStream));
+ }
+
+ _innerStream = innerStream;
+ _sizeLimit = sizeLimit;
+ }
+
+ public override bool CanRead => _innerStream.CanRead;
+
+ public override bool CanSeek => _innerStream.CanSeek;
+
+ public override bool CanWrite => _innerStream.CanWrite;
+
+ public override long Length => _innerStream.Length;
+
+ public override long Position
+ {
+ get
+ {
+ return _innerStream.Position;
+ }
+ set
+ {
+ _innerStream.Position = value;
+ }
+ }
+
+ public override void Flush()
+ {
+ _innerStream.Flush();
+ }
+
+ public override int Read(byte[] buffer, int offset, int count)
+ {
+ var bytesRead = _innerStream.Read(buffer, offset, count);
+
+ _totalBytesRead += bytesRead;
+ if (_totalBytesRead > _sizeLimit)
+ {
+ throw new InvalidOperationException("The maximum number of bytes have been read.");
+ }
+
+ return bytesRead;
+ }
+
+ public override long Seek(long offset, SeekOrigin origin)
+ {
+ return _innerStream.Seek(offset, origin);
+ }
+
+ public override void SetLength(long value)
+ {
+ _innerStream.SetLength(value);
+ }
+
+ public override void Write(byte[] buffer, int offset, int count)
+ {
+ _innerStream.Write(buffer, offset, count);
+ }
+
+ public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
+ {
+ return ReadAsync(buffer.AsMemory(offset, count), cancellationToken).AsTask();
+ }
+
+ public override async ValueTask<int> ReadAsync(Memory<byte> buffer, CancellationToken cancellationToken = default)
+ {
+ var bytesRead = await _innerStream.ReadAsync(buffer, cancellationToken);
+
+ _totalBytesRead += bytesRead;
+ if (_totalBytesRead > _sizeLimit)
+ {
+ throw new InvalidOperationException("The maximum number of bytes have been read.");
+ }
+
+ return bytesRead;
+ }
+}
diff --git a/src/Middleware/RequestDecompression/test/DefaultRequestDecompressionProviderTests.cs b/src/Middleware/RequestDecompression/test/DefaultRequestDecompressionProviderTests.cs
new file mode 100644
index 0000000000..1f39cfef38
--- /dev/null
+++ b/src/Middleware/RequestDecompression/test/DefaultRequestDecompressionProviderTests.cs
@@ -0,0 +1,176 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using Microsoft.Extensions.Logging.Testing;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Options;
+using Microsoft.AspNetCore.Http;
+using Microsoft.Net.Http.Headers;
+using Microsoft.Extensions.Primitives;
+using System.IO.Compression;
+
+namespace Microsoft.AspNetCore.RequestDecompression.Tests;
+
+public class DefaultRequestDecompressionProviderTests
+{
+ [Theory]
+ [InlineData("br", typeof(BrotliStream))]
+ [InlineData("BR", typeof(BrotliStream))]
+ [InlineData("deflate", typeof(DeflateStream))]
+ [InlineData("DEFLATE", typeof(DeflateStream))]
+ [InlineData("gzip", typeof(GZipStream))]
+ [InlineData("GZIP", typeof(GZipStream))]
+ public void GetDecompressionProvider_SupportedContentEncoding_ReturnsProvider(
+ string contentEncoding,
+ Type expectedProviderType)
+ {
+ // Arrange
+ var httpContext = new DefaultHttpContext();
+ httpContext.Request.Headers.Add(HeaderNames.ContentEncoding, contentEncoding);
+
+ var (logger, sink) = GetTestLogger();
+ var options = Options.Create(new RequestDecompressionOptions());
+
+ var provider = new DefaultRequestDecompressionProvider(logger, options);
+
+ // Act
+ var matchingProvider = provider.GetDecompressionStream(httpContext);
+
+ // Assert
+ Assert.NotNull(matchingProvider);
+ Assert.IsType(expectedProviderType, matchingProvider);
+
+ var logMessages = sink.Writes.ToList();
+ AssertLog(logMessages.Single(), LogLevel.Debug,
+ $"The request will be decompressed with '{contentEncoding.ToLowerInvariant()}'.");
+
+ var contentEncodingHeader = httpContext.Request.Headers.ContentEncoding;
+ Assert.Empty(contentEncodingHeader);
+ }
+
+ [Fact]
+ public void GetDecompressionProvider_NoContentEncoding_ReturnsNull()
+ {
+ // Arrange
+ var httpContext = new DefaultHttpContext();
+
+ var (logger, sink) = GetTestLogger();
+ var options = Options.Create(new RequestDecompressionOptions());
+
+ var provider = new DefaultRequestDecompressionProvider(logger, options);
+
+ // Act
+ var matchingProvider = provider.GetDecompressionStream(httpContext);
+
+ // Assert
+ Assert.Null(matchingProvider);
+
+ var logMessages = sink.Writes.ToList();
+ AssertLog(logMessages.Single(), LogLevel.Trace,
+ "The Content-Encoding header is empty or not specified. Skipping request decompression.");
+
+ var contentEncodingHeader = httpContext.Request.Headers.ContentEncoding;
+ Assert.Empty(contentEncodingHeader);
+ }
+
+ [Fact]
+ public void GetDecompressionProvider_UnsupportedContentEncoding_ReturnsNull()
+ {
+ // Arrange
+ var contentEncoding = "custom";
+ var httpContext = new DefaultHttpContext();
+ httpContext.Request.Headers.Add(HeaderNames.ContentEncoding, contentEncoding);
+
+ var (logger, sink) = GetTestLogger();
+ var options = Options.Create(new RequestDecompressionOptions());
+
+ var provider = new DefaultRequestDecompressionProvider(logger, options);
+
+ // Act
+ var matchingProvider = provider.GetDecompressionStream(httpContext);
+
+ // Assert
+ Assert.Null(matchingProvider);
+
+ var logMessages = sink.Writes.ToList();
+ AssertLog(logMessages.Single(),
+ LogLevel.Debug, "No matching request decompression provider found.");
+
+ var contentEncodingHeader = httpContext.Request.Headers.ContentEncoding;
+ Assert.Equal(contentEncoding, contentEncodingHeader);
+ }
+
+ [Fact]
+ public void GetDecompressionProvider_MultipleContentEncodings_ReturnsNull()
+ {
+ // Arrange
+ var contentEncodings = new StringValues(new[] { "br", "gzip" });
+
+ var httpContext = new DefaultHttpContext();
+ httpContext.Request.Headers.Add(HeaderNames.ContentEncoding, contentEncodings);
+
+ var (logger, sink) = GetTestLogger();
+ var options = Options.Create(new RequestDecompressionOptions());
+
+ var provider = new DefaultRequestDecompressionProvider(logger, options);
+
+ // Act
+ var matchingProvider = provider.GetDecompressionStream(httpContext);
+
+ // Assert
+ Assert.Null(matchingProvider);
+
+ var logMessages = sink.Writes.ToList();
+ AssertLog(logMessages.Single(), LogLevel.Debug,
+ "Request decompression is not supported for multiple Content-Encodings.");
+
+ var contentEncodingHeader = httpContext.Request.Headers.ContentEncoding;
+ Assert.Equal(contentEncodings, contentEncodingHeader);
+ }
+
+ [Fact]
+ public void Ctor_NullLogger_Throws()
+ {
+ // Arrange
+ var (logger, _) = GetTestLogger();
+ IOptions<RequestDecompressionOptions> options = null;
+
+ // Act + Assert
+ Assert.Throws<ArgumentNullException>(() =>
+ {
+ new DefaultRequestDecompressionProvider(logger, options);
+ });
+ }
+
+ [Fact]
+ public void Ctor_NullOptions_Throws()
+ {
+ // Arrange
+ ILogger<DefaultRequestDecompressionProvider> logger = null;
+ var options = Options.Create(new RequestDecompressionOptions());
+
+ // Act + Assert
+ Assert.Throws<ArgumentNullException>(() =>
+ {
+ new DefaultRequestDecompressionProvider(logger, options);
+ });
+ }
+
+ private static (ILogger<DefaultRequestDecompressionProvider>, TestSink) GetTestLogger()
+ {
+ var sink = new TestSink(
+ TestSink.EnableWithTypeName<DefaultRequestDecompressionProvider>,
+ TestSink.EnableWithTypeName<DefaultRequestDecompressionProvider>);
+
+ var loggerFactory = new TestLoggerFactory(sink, enabled: true);
+ var logger = loggerFactory.CreateLogger<DefaultRequestDecompressionProvider>();
+
+ return (logger, sink);
+ }
+
+ private static void AssertLog(WriteContext log, LogLevel level, string message)
+ {
+ Assert.Equal(level, log.LogLevel);
+ Assert.Equal(message, log.State.ToString());
+ }
+}
diff --git a/src/Middleware/RequestDecompression/test/Microsoft.AspNetCore.RequestDecompression.Tests.csproj b/src/Middleware/RequestDecompression/test/Microsoft.AspNetCore.RequestDecompression.Tests.csproj
new file mode 100644
index 0000000000..21eb7830cc
--- /dev/null
+++ b/src/Middleware/RequestDecompression/test/Microsoft.AspNetCore.RequestDecompression.Tests.csproj
@@ -0,0 +1,14 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <Reference Include="Microsoft.AspNetCore.Http" />
+ <Reference Include="Microsoft.AspNetCore.RequestDecompression" />
+ <Reference Include="Microsoft.AspNetCore.TestHost" />
+ <Reference Include="Microsoft.Net.Http.Headers" />
+ </ItemGroup>
+
+</Project> \ No newline at end of file
diff --git a/src/Middleware/RequestDecompression/test/RequestDecompressionBuilderExtensionsTests.cs b/src/Middleware/RequestDecompression/test/RequestDecompressionBuilderExtensionsTests.cs
new file mode 100644
index 0000000000..b30aaf0122
--- /dev/null
+++ b/src/Middleware/RequestDecompression/test/RequestDecompressionBuilderExtensionsTests.cs
@@ -0,0 +1,22 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using Microsoft.AspNetCore.Builder;
+
+namespace Microsoft.AspNetCore.RequestDecompression.Tests;
+
+public class RequestDecompressionBuilderExtensionsTests
+{
+ [Fact]
+ public void UseRequestDecompression_NullApplicationBuilder_Throws()
+ {
+ // Arrange
+ IApplicationBuilder builder = null;
+
+ // Act + Assert
+ Assert.Throws<ArgumentNullException>(() =>
+ {
+ builder.UseRequestDecompression();
+ });
+ }
+}
diff --git a/src/Middleware/RequestDecompression/test/RequestDecompressionMiddlewareTests.cs b/src/Middleware/RequestDecompression/test/RequestDecompressionMiddlewareTests.cs
new file mode 100644
index 0000000000..e28e0b6c6b
--- /dev/null
+++ b/src/Middleware/RequestDecompression/test/RequestDecompressionMiddlewareTests.cs
@@ -0,0 +1,945 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System.Globalization;
+using System.IO.Compression;
+using System.Net.Http;
+using System.Text;
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Http.Features;
+using Microsoft.AspNetCore.Http.Metadata;
+using Microsoft.AspNetCore.TestHost;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Hosting;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Logging.Testing;
+using Microsoft.Extensions.Primitives;
+
+namespace Microsoft.AspNetCore.RequestDecompression.Tests;
+
+public class RequestDecompressionMiddlewareTests
+{
+ private const string TestRequestBodyData = "Test Request Body Data";
+
+ private static byte[] GetUncompressedContent(string input = TestRequestBodyData)
+ {
+ return Encoding.UTF8.GetBytes(input);
+ }
+
+ private static async Task<byte[]> GetCompressedContent(
+ Func<Stream, Stream> compressorDelegate,
+ byte[] uncompressedBytes)
+ {
+ await using var uncompressedStream = new MemoryStream(uncompressedBytes);
+
+ await using var compressedStream = new MemoryStream();
+ await using (var compressor = compressorDelegate(compressedStream))
+ {
+ await uncompressedStream.CopyToAsync(compressor);
+ }
+
+ return compressedStream.ToArray();
+ }
+
+ private static async Task<byte[]> GetBrotliCompressedContent(byte[] uncompressedBytes)
+ {
+ static Stream compressorDelegate(Stream compressedContent) =>
+ new BrotliStream(compressedContent, CompressionMode.Compress);
+
+ return await GetCompressedContent(compressorDelegate, uncompressedBytes);
+ }
+
+ private static async Task<byte[]> GetDeflateCompressedContent(byte[] uncompressedBytes)
+ {
+ static Stream compressorDelegate(Stream compressedContent) =>
+ new DeflateStream(compressedContent, CompressionMode.Compress);
+
+ return await GetCompressedContent(compressorDelegate, uncompressedBytes);
+ }
+
+ private static async Task<byte[]> GetGZipCompressedContent(byte[] uncompressedBytes)
+ {
+ static Stream compressorDelegate(Stream compressedContent) =>
+ new GZipStream(compressedContent, CompressionMode.Compress);
+
+ return await GetCompressedContent(compressorDelegate, uncompressedBytes);
+ }
+
+ [Fact]
+ public async Task Request_ContentEncodingBrotli_Decompressed()
+ {
+ // Arrange
+ var contentEncoding = "br";
+ var uncompressedBytes = GetUncompressedContent();
+ var compressedBytes = await GetBrotliCompressedContent(uncompressedBytes);
+
+ // Act
+ var (logMessages, decompressedBytes) = await InvokeMiddleware(compressedBytes, new[] { contentEncoding });
+
+ // Assert
+ AssertDecompressedWithLog(logMessages, contentEncoding.ToLowerInvariant());
+ Assert.Equal(uncompressedBytes, decompressedBytes);
+ }
+
+ [Fact]
+ public async Task Request_ContentEncodingDeflate_Decompressed()
+ {
+ // Arrange
+ var contentEncoding = "deflate";
+ var uncompressedBytes = GetUncompressedContent();
+ var compressedBytes = await GetDeflateCompressedContent(uncompressedBytes);
+
+ // Act
+ var (logMessages, decompressedBytes) = await InvokeMiddleware(compressedBytes, new[] { contentEncoding });
+
+ // Assert
+ AssertDecompressedWithLog(logMessages, contentEncoding.ToLowerInvariant());
+ Assert.Equal(uncompressedBytes, decompressedBytes);
+ }
+
+ [Fact]
+ public async Task Request_ContentEncodingGzip_Decompressed()
+ {
+ // Arrange
+ var contentEncoding = "gzip";
+ var uncompressedBytes = GetUncompressedContent();
+ var compressedBytes = await GetGZipCompressedContent(uncompressedBytes);
+
+ // Act
+ var (logMessages, decompressedBytes) = await InvokeMiddleware(compressedBytes, new[] { contentEncoding });
+
+ // Assert
+ AssertDecompressedWithLog(logMessages, contentEncoding.ToLowerInvariant());
+ Assert.Equal(uncompressedBytes, decompressedBytes);
+ }
+
+ [Fact]
+ public async Task Request_NoContentEncoding_NotDecompressed()
+ {
+ // Arrange
+ var uncompressedBytes = GetUncompressedContent();
+
+ // Act
+ var (logMessages, outputBytes) = await InvokeMiddleware(uncompressedBytes);
+
+ // Assert
+ var logMessage = Assert.Single(logMessages);
+ AssertLog(logMessage, LogLevel.Trace, "The Content-Encoding header is empty or not specified. Skipping request decompression.");
+ Assert.Equal(uncompressedBytes, outputBytes);
+ }
+
+ [Fact]
+ public async Task Request_UnsupportedContentEncoding_NotDecompressed()
+ {
+ // Arrange
+ var uncompressedBytes = GetUncompressedContent();
+ var compressedBytes = await GetGZipCompressedContent(uncompressedBytes);
+ var contentEncoding = "custom";
+
+ // Act
+ var (logMessages, outputBytes) = await InvokeMiddleware(compressedBytes, new[] { contentEncoding });
+
+ // Assert
+ AssertNoDecompressionProviderLog(logMessages);
+ Assert.Equal(compressedBytes, outputBytes);
+ }
+
+ [Fact]
+ public async Task Request_MultipleContentEncodings_NotDecompressed()
+ {
+ // Arrange
+ var uncompressedBytes = GetUncompressedContent();
+ var inputBytes = await GetGZipCompressedContent(uncompressedBytes);
+ var contentEncodings = new[] { "br", "gzip" };
+
+ // Act
+ var (logMessages, outputBytes) = await InvokeMiddleware(inputBytes, contentEncodings);
+
+ // Assert
+ var logMessage = Assert.Single(logMessages);
+ AssertLog(logMessage, LogLevel.Debug, "Request decompression is not supported for multiple Content-Encodings.");
+ Assert.Equal(inputBytes, outputBytes);
+ }
+
+ [Fact]
+ public async Task Request_MiddlewareAddedMultipleTimes_OnlyDecompressedOnce()
+ {
+ // Arrange
+ var uncompressedBytes = GetUncompressedContent();
+ var compressedBytes = await GetGZipCompressedContent(uncompressedBytes);
+ var contentEncoding = "gzip";
+
+ var decompressedBytes = Array.Empty<byte>();
+
+ var sink = new TestSink(
+ TestSink.EnableWithTypeName<DefaultRequestDecompressionProvider>,
+ TestSink.EnableWithTypeName<DefaultRequestDecompressionProvider>);
+ var loggerFactory = new TestLoggerFactory(sink, enabled: true);
+
+ using var host = new HostBuilder()
+ .ConfigureWebHost(webHostBuilder =>
+ {
+ webHostBuilder
+ .UseTestServer()
+ .ConfigureServices(services =>
+ {
+ services.AddRequestDecompression();
+ services.AddSingleton<ILoggerFactory>(loggerFactory);
+ })
+ .Configure(app =>
+ {
+ app.Use((context, next) =>
+ {
+ context.Features.Set<IHttpMaxRequestBodySizeFeature>(
+ new FakeHttpMaxRequestBodySizeFeature());
+ return next(context);
+ });
+ app.UseRequestDecompression();
+ app.UseRequestDecompression();
+ app.Run(async context =>
+ {
+ await using var ms = new MemoryStream();
+ await context.Request.Body.CopyToAsync(ms, context.RequestAborted);
+ decompressedBytes = ms.ToArray();
+ });
+ });
+ }).Build();
+
+ await host.StartAsync();
+
+ var server = host.GetTestServer();
+ var client = server.CreateClient();
+
+ using var request = new HttpRequestMessage(HttpMethod.Post, "");
+ request.Content = new ByteArrayContent(compressedBytes);
+ request.Content.Headers.ContentEncoding.Add(contentEncoding);
+
+ // Act
+ await client.SendAsync(request);
+
+ // Assert
+ var logMessages = sink.Writes.ToList();
+
+ Assert.Equal(2, logMessages.Count);
+ AssertLog(logMessages.First(), LogLevel.Debug, $"The request will be decompressed with '{contentEncoding}'.");
+ AssertLog(logMessages.Skip(1).First(), LogLevel.Trace, "The Content-Encoding header is empty or not specified. Skipping request decompression.");
+
+ Assert.Equal(uncompressedBytes, decompressedBytes);
+ }
+
+ [Theory]
+ [InlineData(true)]
+ [InlineData(false)]
+ public async Task Request_Decompressed_ContentEncodingHeaderRemoved(bool isDecompressed)
+ {
+ // Arrange
+ var contentEncoding = isDecompressed ? "gzip" : "custom";
+ var contentEncodingHeader = new StringValues();
+
+ var uncompressedBytes = GetUncompressedContent();
+ var compressedBytes = await GetGZipCompressedContent(uncompressedBytes);
+
+ var outputBytes = Array.Empty<byte>();
+
+ var sink = new TestSink(
+ TestSink.EnableWithTypeName<DefaultRequestDecompressionProvider>,
+ TestSink.EnableWithTypeName<DefaultRequestDecompressionProvider>);
+ var loggerFactory = new TestLoggerFactory(sink, enabled: true);
+
+ using var host = new HostBuilder()
+ .ConfigureWebHost(webHostBuilder =>
+ {
+ webHostBuilder
+ .UseTestServer()
+ .ConfigureServices(services =>
+ {
+ services.AddRequestDecompression();
+ services.AddSingleton<ILoggerFactory>(loggerFactory);
+ })
+ .Configure(app =>
+ {
+ app.Use((context, next) =>
+ {
+ context.Features.Set<IHttpMaxRequestBodySizeFeature>(
+ new FakeHttpMaxRequestBodySizeFeature());
+ return next(context);
+ });
+ app.UseRequestDecompression();
+ app.Run(async context =>
+ {
+ contentEncodingHeader = context.Request.Headers.ContentEncoding;
+
+ await using var ms = new MemoryStream();
+ await context.Request.Body.CopyToAsync(ms, context.RequestAborted);
+ outputBytes = ms.ToArray();
+ });
+ });
+ }).Build();
+
+ await host.StartAsync();
+
+ var server = host.GetTestServer();
+ var client = server.CreateClient();
+
+ using var request = new HttpRequestMessage(HttpMethod.Post, "");
+ request.Content = new ByteArrayContent(compressedBytes);
+ request.Content.Headers.ContentEncoding.Add(contentEncoding);
+
+ // Act
+ await client.SendAsync(request);
+
+ // Assert
+ var logMessages = sink.Writes.ToList();
+
+ if (isDecompressed)
+ {
+ Assert.Empty(contentEncodingHeader);
+
+ AssertDecompressedWithLog(logMessages, contentEncoding);
+ Assert.Equal(uncompressedBytes, outputBytes);
+ }
+ else
+ {
+ Assert.Equal(contentEncoding, contentEncodingHeader);
+
+ AssertNoDecompressionProviderLog(logMessages);
+ Assert.Equal(compressedBytes, outputBytes);
+ }
+ }
+
+ [Fact]
+ public async Task Request_InvalidDataForContentEncoding_ThrowsInvalidOperationException()
+ {
+ // Arrange
+ var uncompressedBytes = GetUncompressedContent();
+ var compressedBytes = await GetGZipCompressedContent(uncompressedBytes);
+ var contentEncoding = "br";
+
+ Exception exception = null;
+
+ var sink = new TestSink(
+ TestSink.EnableWithTypeName<DefaultRequestDecompressionProvider>,
+ TestSink.EnableWithTypeName<DefaultRequestDecompressionProvider>);
+ var loggerFactory = new TestLoggerFactory(sink, enabled: true);
+
+ using var host = new HostBuilder()
+ .ConfigureWebHost(webHostBuilder =>
+ {
+ webHostBuilder
+ .UseTestServer()
+ .ConfigureServices(services =>
+ {
+ services.AddRequestDecompression();
+ services.AddSingleton<ILoggerFactory>(loggerFactory);
+ })
+ .Configure(app =>
+ {
+ app.Use((context, next) =>
+ {
+ context.Features.Set<IHttpMaxRequestBodySizeFeature>(
+ new FakeHttpMaxRequestBodySizeFeature());
+ return next(context);
+ });
+ app.UseRequestDecompression();
+ app.Run(async context =>
+ {
+ exception = await Record.ExceptionAsync(async () =>
+ {
+ using var ms = new MemoryStream();
+ await context.Request.Body.CopyToAsync(ms, context.RequestAborted);
+ });
+ });
+ });
+ }).Build();
+
+ await host.StartAsync();
+
+ var server = host.GetTestServer();
+ var client = server.CreateClient();
+
+ using var request = new HttpRequestMessage(HttpMethod.Post, "");
+ request.Content = new ByteArrayContent(compressedBytes);
+ request.Content.Headers.ContentEncoding.Add(contentEncoding);
+
+ // Act
+ await client.SendAsync(request);
+
+ // Assert
+ var logMessages = sink.Writes.ToList();
+
+ AssertDecompressedWithLog(logMessages, contentEncoding.ToLowerInvariant());
+
+ Assert.NotNull(exception);
+ Assert.IsAssignableFrom<InvalidOperationException>(exception);
+ }
+
+ [Fact]
+ public async Task Options_RegisterCustomDecompressionProvider()
+ {
+ // Arrange
+ var uncompressedBytes = GetUncompressedContent();
+ var compressedBytes = await GetGZipCompressedContent(uncompressedBytes);
+ var contentEncoding = "custom";
+
+ // Act
+ var (logMessages, decompressedBytes) =
+ await InvokeMiddleware(
+ compressedBytes,
+ new[] { contentEncoding },
+ configure: (RequestDecompressionOptions options) =>
+ {
+ options.DecompressionProviders.Add(contentEncoding, new CustomDecompressionProvider());
+ });
+
+ // Assert
+ AssertDecompressedWithLog(logMessages, contentEncoding);
+ Assert.Equal(uncompressedBytes, decompressedBytes);
+ }
+
+ [Theory]
+ [InlineData(true)]
+ [InlineData(false)]
+ public async Task Endpoint_HasRequestSizeLimit_UsedForRequest(bool exceedsLimit)
+ {
+ // Arrange
+ long attributeSizeLimit = 10;
+ long featureSizeLimit = 5;
+
+ var contentEncoding = "gzip";
+ var uncompressedBytes = new byte[attributeSizeLimit + (exceedsLimit ? 1 : 0)];
+ var compressedBytes = await GetGZipCompressedContent(uncompressedBytes);
+
+ var decompressedBytes = Array.Empty<byte>();
+ Exception exception = null;
+
+ var sink = new TestSink(
+ TestSink.EnableWithTypeName<DefaultRequestDecompressionProvider>,
+ TestSink.EnableWithTypeName<DefaultRequestDecompressionProvider>);
+ var loggerFactory = new TestLoggerFactory(sink, enabled: true);
+
+ using var host = new HostBuilder()
+ .ConfigureWebHost(webHostBuilder =>
+ {
+ webHostBuilder
+ .UseTestServer()
+ .ConfigureServices(services =>
+ {
+ services.AddRequestDecompression();
+ services.AddSingleton<ILoggerFactory>(loggerFactory);
+ })
+ .Configure(app =>
+ {
+ app.Use((context, next) =>
+ {
+ context.Features.Set<IEndpointFeature>(
+ GetFakeEndpointFeature(attributeSizeLimit));
+ context.Features.Set<IHttpMaxRequestBodySizeFeature>(
+ new FakeHttpMaxRequestBodySizeFeature(featureSizeLimit));
+
+ return next(context);
+ });
+ app.UseRequestDecompression();
+ app.Run(async context =>
+ {
+ await using var ms = new MemoryStream();
+
+ exception = await Record.ExceptionAsync(async () =>
+ {
+ await context.Request.Body.CopyToAsync(ms, context.RequestAborted);
+ decompressedBytes = ms.ToArray();
+ });
+
+ decompressedBytes = ms.ToArray();
+ });
+ });
+ }).Build();
+
+ await host.StartAsync();
+
+ var server = host.GetTestServer();
+ var client = server.CreateClient();
+
+ using var request = new HttpRequestMessage(HttpMethod.Post, "");
+ request.Content = new ByteArrayContent(compressedBytes);
+ request.Content.Headers.ContentEncoding.Add(contentEncoding);
+
+ // Act
+ await client.SendAsync(request);
+
+ // Assert
+ var logMessages = sink.Writes.ToList();
+ AssertDecompressedWithLog(logMessages, contentEncoding);
+
+ if (exceedsLimit)
+ {
+ Assert.NotNull(exception);
+ Assert.IsAssignableFrom<InvalidOperationException>(exception);
+ Assert.Equal("The maximum number of bytes have been read.", exception.Message);
+ }
+ else
+ {
+ Assert.Null(exception);
+ Assert.Equal(uncompressedBytes, decompressedBytes);
+ }
+ }
+
+ [Theory]
+ [InlineData(true)]
+ [InlineData(false)]
+ public async Task Feature_HasRequestSizeLimit_UsedForRequest(bool exceedsLimit)
+ {
+ // Arrange
+ long featureSizeLimit = 10;
+
+ var contentEncoding = "gzip";
+ var uncompressedBytes = new byte[featureSizeLimit + (exceedsLimit ? 1 : 0)];
+ var compressedBytes = await GetGZipCompressedContent(uncompressedBytes);
+
+ var decompressedBytes = Array.Empty<byte>();
+ Exception exception = null;
+
+ var sink = new TestSink(
+ TestSink.EnableWithTypeName<DefaultRequestDecompressionProvider>,
+ TestSink.EnableWithTypeName<DefaultRequestDecompressionProvider>);
+ var loggerFactory = new TestLoggerFactory(sink, enabled: true);
+
+ using var host = new HostBuilder()
+ .ConfigureWebHost(webHostBuilder =>
+ {
+ webHostBuilder
+ .UseTestServer()
+ .ConfigureServices(services =>
+ {
+ services.AddRequestDecompression();
+ services.AddSingleton<ILoggerFactory>(loggerFactory);
+ })
+ .Configure(app =>
+ {
+ app.Use((context, next) =>
+ {
+ context.Features.Set<IHttpMaxRequestBodySizeFeature>(
+ new FakeHttpMaxRequestBodySizeFeature(featureSizeLimit));
+
+ return next(context);
+ });
+ app.UseRequestDecompression();
+ app.Run(async context =>
+ {
+ await using var ms = new MemoryStream();
+
+ exception = await Record.ExceptionAsync(async () =>
+ {
+ await context.Request.Body.CopyToAsync(ms, context.RequestAborted);
+ decompressedBytes = ms.ToArray();
+ });
+
+ decompressedBytes = ms.ToArray();
+ });
+ });
+ }).Build();
+
+ await host.StartAsync();
+
+ var server = host.GetTestServer();
+ var client = server.CreateClient();
+
+ using var request = new HttpRequestMessage(HttpMethod.Post, "");
+ request.Content = new ByteArrayContent(compressedBytes);
+ request.Content.Headers.ContentEncoding.Add(contentEncoding);
+
+ // Act
+ await client.SendAsync(request);
+
+ // Assert
+ var logMessages = sink.Writes.ToList();
+ AssertDecompressedWithLog(logMessages, contentEncoding);
+
+ if (exceedsLimit)
+ {
+ Assert.NotNull(exception);
+ Assert.IsAssignableFrom<InvalidOperationException>(exception);
+ Assert.Equal("The maximum number of bytes have been read.", exception.Message);
+ }
+ else
+ {
+ Assert.Null(exception);
+ Assert.Equal(uncompressedBytes, decompressedBytes);
+ }
+ }
+
+ [Theory]
+ [InlineData(true)]
+ [InlineData(false)]
+ public async Task Endpoint_DoesNotHaveSizeLimitMetadata(bool isCompressed)
+ {
+ // Arrange
+ var sink = new TestSink();
+ var logger = new TestLogger<RequestDecompressionMiddleware>(
+ new TestLoggerFactory(sink, enabled: true));
+ IRequestDecompressionProvider provider = new FakeRequestDecompressionProvider(isCompressed);
+
+ var middleware = new RequestDecompressionMiddleware(
+ c =>
+ {
+ c.Response.StatusCode = StatusCodes.Status200OK;
+ return Task.CompletedTask;
+ },
+ logger,
+ provider);
+
+ var context = new DefaultHttpContext();
+
+ IEndpointFeature endpointFeature = new FakeEndpointFeature
+ {
+ Endpoint = new Endpoint(
+ requestDelegate: null,
+ metadata: new EndpointMetadataCollection(),
+ displayName: null)
+ };
+ context.HttpContext.Features.Set(endpointFeature);
+
+ long expectedRequestSizeLimit = 100;
+ IHttpMaxRequestBodySizeFeature maxRequestBodySizeFeature =
+ new FakeHttpMaxRequestBodySizeFeature(expectedRequestSizeLimit);
+ context.HttpContext.Features.Set(maxRequestBodySizeFeature);
+
+ // Act
+ await middleware.Invoke(context);
+
+ // Assert
+ var logMessages = sink.Writes.ToList();
+ AssertLog(Assert.Single(logMessages), LogLevel.Debug,
+ $"The endpoint does not specify the {nameof(IRequestSizeLimitMetadata)}.");
+
+ var actualRequestSizeLimit = maxRequestBodySizeFeature.MaxRequestBodySize;
+ Assert.Equal(expectedRequestSizeLimit, actualRequestSizeLimit);
+ }
+
+ [Theory]
+ [InlineData(true)]
+ [InlineData(false)]
+ public async Task Endpoint_DoesNotHaveBodySizeFeature(bool isCompressed)
+ {
+ // Arrange
+ var sink = new TestSink();
+ var logger = new TestLogger<RequestDecompressionMiddleware>(
+ new TestLoggerFactory(sink, enabled: true));
+ IRequestDecompressionProvider provider = new FakeRequestDecompressionProvider(isCompressed);
+
+ var middleware = new RequestDecompressionMiddleware(
+ c =>
+ {
+ c.Response.StatusCode = StatusCodes.Status200OK;
+ return Task.CompletedTask;
+ },
+ logger,
+ provider);
+
+ var context = new DefaultHttpContext();
+
+ IEndpointFeature endpointFeature = GetFakeEndpointFeature(100);
+ context.HttpContext.Features.Set(endpointFeature);
+
+ IHttpMaxRequestBodySizeFeature maxRequestBodySizeFeature = null;
+ context.HttpContext.Features.Set(maxRequestBodySizeFeature);
+
+ // Act
+ await middleware.Invoke(context);
+
+ // Assert
+ var logMessages = sink.Writes.ToList();
+ AssertLog(Assert.Single(logMessages), LogLevel.Warning,
+ $"A request body size limit could not be applied. This server does not support the {nameof(IHttpMaxRequestBodySizeFeature)}.");
+ }
+
+ [Theory]
+ [InlineData(true)]
+ [InlineData(false)]
+ public async Task Endpoint_BodySizeFeatureIsReadOnly(bool isCompressed)
+ {
+ // Arrange
+ var sink = new TestSink();
+ var logger = new TestLogger<RequestDecompressionMiddleware>(
+ new TestLoggerFactory(sink, enabled: true));
+ IRequestDecompressionProvider provider = new FakeRequestDecompressionProvider(isCompressed);
+
+ var middleware = new RequestDecompressionMiddleware(
+ c =>
+ {
+ c.Response.StatusCode = StatusCodes.Status200OK;
+ return Task.CompletedTask;
+ },
+ logger,
+ provider);
+
+ var context = new DefaultHttpContext();
+
+ IEndpointFeature endpointFeature = GetFakeEndpointFeature(100);
+ context.HttpContext.Features.Set(endpointFeature);
+
+ long expectedRequestSizeLimit = 50;
+ IHttpMaxRequestBodySizeFeature maxRequestBodySizeFeature =
+ new FakeHttpMaxRequestBodySizeFeature(expectedRequestSizeLimit, isReadOnly: true);
+ context.HttpContext.Features.Set(maxRequestBodySizeFeature);
+
+ // Act
+ await middleware.Invoke(context);
+
+ // Assert
+ var logMessages = sink.Writes.ToList();
+ AssertLog(Assert.Single(logMessages), LogLevel.Warning,
+ $"A request body size limit could not be applied. The {nameof(IHttpMaxRequestBodySizeFeature)} for the server is read-only.");
+
+ var actualRequestSizeLimit = maxRequestBodySizeFeature.MaxRequestBodySize;
+ Assert.Equal(expectedRequestSizeLimit, actualRequestSizeLimit);
+ }
+
+ [Theory]
+ [InlineData(true, true)]
+ [InlineData(true, false)]
+ [InlineData(false, false)]
+ [InlineData(false, true)]
+ public async Task Endpoint_HasBodySizeFeature_SetUsingSizeLimitMetadata(bool isCompressed, bool isRequestSizeLimitDisabled)
+ {
+ // Arrange
+ var sink = new TestSink();
+ var logger = new TestLogger<RequestDecompressionMiddleware>(
+ new TestLoggerFactory(sink, enabled: true));
+ IRequestDecompressionProvider provider = new FakeRequestDecompressionProvider(isCompressed);
+
+ var middleware = new RequestDecompressionMiddleware(
+ c =>
+ {
+ c.Response.StatusCode = StatusCodes.Status200OK;
+ return Task.CompletedTask;
+ },
+ logger,
+ provider);
+
+ var context = new DefaultHttpContext();
+
+ long? expectedRequestSizeLimit = isRequestSizeLimitDisabled ? null : 100;
+ IEndpointFeature endpointFeature = GetFakeEndpointFeature(expectedRequestSizeLimit);
+ context.HttpContext.Features.Set(endpointFeature);
+
+ IHttpMaxRequestBodySizeFeature maxRequestBodySizeFeature =
+ new FakeHttpMaxRequestBodySizeFeature(50);
+ context.HttpContext.Features.Set(maxRequestBodySizeFeature);
+
+ // Act
+ await middleware.Invoke(context);
+
+ // Assert
+ var logMessages = sink.Writes.ToList();
+
+ if (isRequestSizeLimitDisabled)
+ {
+ AssertLog(Assert.Single(logMessages), LogLevel.Debug,
+ "The maximum request body size as been disabled.");
+ }
+ else
+ {
+ AssertLog(Assert.Single(logMessages), LogLevel.Debug,
+ $"The maximum request body size has been set to {expectedRequestSizeLimit.Value.ToString(CultureInfo.InvariantCulture)}.");
+ }
+
+ var actualRequestSizeLimit = maxRequestBodySizeFeature.MaxRequestBodySize;
+ Assert.Equal(expectedRequestSizeLimit, actualRequestSizeLimit);
+ }
+
+ [Fact]
+ public void Ctor_NullRequestDelegate_Throws()
+ {
+ // Arrange
+ RequestDelegate requestDelegate = null;
+ var logger = new TestLogger<RequestDecompressionMiddleware>(
+ new TestLoggerFactory(new TestSink(), enabled: true));
+ var provider = new FakeRequestDecompressionProvider();
+
+ // Act + Assert
+ Assert.Throws<ArgumentNullException>(() =>
+ {
+ new RequestDecompressionMiddleware(requestDelegate, logger, provider);
+ });
+ }
+
+ [Fact]
+ public void Ctor_NullLogger_Throws()
+ {
+ // Arrange
+ static Task requestDelegate(HttpContext context) => Task.FromResult(context);
+ ILogger<RequestDecompressionMiddleware> logger = null;
+ var provider = new FakeRequestDecompressionProvider();
+
+ // Act + Assert
+ Assert.Throws<ArgumentNullException>(() =>
+ {
+ new RequestDecompressionMiddleware(requestDelegate, logger, provider);
+ });
+ }
+
+ [Fact]
+ public void Ctor_NullRequestDecompressionProvider_Throws()
+ {
+ // Arrange
+ static Task requestDelegate(HttpContext context) => Task.FromResult(context);
+ var logger = new TestLogger<RequestDecompressionMiddleware>(
+ new TestLoggerFactory(new TestSink(), enabled: true));
+ IRequestDecompressionProvider provider = null;
+
+ // Act + Assert
+ Assert.Throws<ArgumentNullException>(() =>
+ {
+ new RequestDecompressionMiddleware(requestDelegate, logger, provider);
+ });
+ }
+
+ private class FakeRequestDecompressionProvider : IRequestDecompressionProvider
+ {
+ private readonly bool _isCompressed;
+
+ public FakeRequestDecompressionProvider(bool isCompressed = false)
+ {
+ _isCompressed = isCompressed;
+ }
+
+#nullable enable
+ public Stream? GetDecompressionStream(HttpContext context)
+ => _isCompressed
+ ? new MemoryStream()
+ : null;
+#nullable disable
+ }
+
+ private static void AssertLog(WriteContext log, LogLevel level, string message)
+ {
+ Assert.Equal(level, log.LogLevel);
+ Assert.Equal(message, log.State.ToString());
+ }
+
+ private static void AssertDecompressedWithLog(List<WriteContext> logMessages, string encoding)
+ {
+ var logMessage = Assert.Single(logMessages);
+ AssertLog(logMessage, LogLevel.Debug, $"The request will be decompressed with '{encoding}'.");
+ }
+
+ private static void AssertNoDecompressionProviderLog(List<WriteContext> logMessages)
+ {
+ var logMessage = Assert.Single(logMessages);
+ AssertLog(logMessage, LogLevel.Debug, "No matching request decompression provider found.");
+ }
+
+ private static async Task<(List<WriteContext>, byte[])> InvokeMiddleware(
+ byte[] compressedContent,
+ string[] contentEncodings = null,
+ Action<RequestDecompressionOptions> configure = null)
+ {
+ var sink = new TestSink(
+ TestSink.EnableWithTypeName<DefaultRequestDecompressionProvider>,
+ TestSink.EnableWithTypeName<DefaultRequestDecompressionProvider>);
+ var loggerFactory = new TestLoggerFactory(sink, enabled: true);
+
+ var outputContent = Array.Empty<byte>();
+
+ using var host = new HostBuilder()
+ .ConfigureWebHost(webHostBuilder =>
+ {
+ webHostBuilder
+ .UseTestServer()
+ .ConfigureServices(services =>
+ {
+ services.AddRequestDecompression(configure ?? (_ => { }));
+ services.AddSingleton<ILoggerFactory>(loggerFactory);
+ })
+ .Configure(app =>
+ {
+ app.Use((context, next) =>
+ {
+ context.Features.Set<IHttpMaxRequestBodySizeFeature>(
+ new FakeHttpMaxRequestBodySizeFeature());
+ return next(context);
+ });
+ app.UseRequestDecompression();
+ app.Run(async context =>
+ {
+ await using var ms = new MemoryStream();
+ await context.Request.Body.CopyToAsync(ms, context.RequestAborted);
+ outputContent = ms.ToArray();
+ });
+ });
+ }).Build();
+
+ await host.StartAsync();
+
+ var server = host.GetTestServer();
+ var client = server.CreateClient();
+
+ using var request = new HttpRequestMessage(HttpMethod.Post, "");
+ request.Content = new ByteArrayContent(compressedContent);
+
+ if (contentEncodings != null)
+ {
+ foreach (var encoding in contentEncodings)
+ {
+ request.Content.Headers.ContentEncoding.Add(encoding);
+ }
+ }
+
+ await client.SendAsync(request);
+
+ return (sink.Writes.ToList(), outputContent);
+ }
+ private class CustomDecompressionProvider : IDecompressionProvider
+ {
+ public Stream GetDecompressionStream(Stream stream)
+ {
+ return new GZipStream(stream, CompressionMode.Decompress);
+ }
+ }
+
+ private static FakeEndpointFeature GetFakeEndpointFeature(long? requestSizeLimit)
+ {
+ var requestSizeLimitMetadata = new FakeRequestSizeLimitMetadata
+ {
+ MaxRequestBodySize = requestSizeLimit
+ };
+
+ var endpointMetadata =
+ new EndpointMetadataCollection(new[] { requestSizeLimitMetadata });
+
+ return new FakeEndpointFeature
+ {
+ Endpoint = new Endpoint(
+ requestDelegate: null,
+ metadata: endpointMetadata,
+ displayName: null)
+ };
+ }
+
+ private class FakeEndpointFeature : IEndpointFeature
+ {
+ public Endpoint Endpoint { get; set; }
+ }
+
+ private class FakeRequestSizeLimitMetadata : IRequestSizeLimitMetadata
+ {
+ public long? MaxRequestBodySize { get; set; }
+ }
+
+ private class FakeHttpMaxRequestBodySizeFeature : IHttpMaxRequestBodySizeFeature
+ {
+ public FakeHttpMaxRequestBodySizeFeature(
+ long? maxRequestBodySize = null,
+ bool isReadOnly = false)
+ {
+ MaxRequestBodySize = maxRequestBodySize;
+ IsReadOnly = isReadOnly;
+ }
+
+ public bool IsReadOnly { get; }
+
+ public long? MaxRequestBodySize { get; set; }
+ }
+}
diff --git a/src/Middleware/RequestDecompression/test/RequestDecompressionOptionsTests.cs b/src/Middleware/RequestDecompression/test/RequestDecompressionOptionsTests.cs
new file mode 100644
index 0000000000..eb05050b2d
--- /dev/null
+++ b/src/Middleware/RequestDecompression/test/RequestDecompressionOptionsTests.cs
@@ -0,0 +1,30 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace Microsoft.AspNetCore.RequestDecompression.Tests;
+
+public class RequestDecompressionOptionsTests
+{
+ [Fact]
+ public void Options_InitializedWithDefaultProviders()
+ {
+ // Arrange
+ var defaultProviderCount = 3;
+
+ // Act
+ var options = new RequestDecompressionOptions();
+
+ // Assert
+ var providers = options.DecompressionProviders;
+ Assert.Equal(defaultProviderCount, providers.Count);
+
+ var brotliProvider = Assert.Contains("br", providers);
+ Assert.IsType<BrotliDecompressionProvider>(brotliProvider);
+
+ var deflateProvider = Assert.Contains("deflate", providers);
+ Assert.IsType<DeflateDecompressionProvider>(deflateProvider);
+
+ var gzipProvider = Assert.Contains("gzip", providers);
+ Assert.IsType<GZipDecompressionProvider>(gzipProvider);
+ }
+}
diff --git a/src/Middleware/RequestDecompression/test/RequestDecompressionServiceExtensionsTests.cs b/src/Middleware/RequestDecompression/test/RequestDecompressionServiceExtensionsTests.cs
new file mode 100644
index 0000000000..00c4f9885f
--- /dev/null
+++ b/src/Middleware/RequestDecompression/test/RequestDecompressionServiceExtensionsTests.cs
@@ -0,0 +1,37 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using Microsoft.Extensions.DependencyInjection;
+
+namespace Microsoft.AspNetCore.RequestDecompression.Tests;
+
+public class RequestDecompressionServiceExtensionsTests
+{
+ [Fact]
+ public void AddRequestDecompression_NullServiceCollection_Throws()
+ {
+ // Arrange
+ IServiceCollection serviceCollection = null;
+ var configureOptions = (RequestDecompressionOptions options) => { };
+
+ // Act + Assert
+ Assert.Throws<ArgumentNullException>(() =>
+ {
+ serviceCollection.AddRequestDecompression(configureOptions);
+ });
+ }
+
+ [Fact]
+ public void AddRequestDecompression_NullConfigureOptions_Throws()
+ {
+ // Arrange
+ var serviceCollection = new ServiceCollection();
+ Action<RequestDecompressionOptions> configureOptions = null;
+
+ // Act + Assert
+ Assert.Throws<ArgumentNullException>(() =>
+ {
+ serviceCollection.AddRequestDecompression(configureOptions);
+ });
+ }
+}
diff --git a/src/Middleware/RequestDecompression/test/SizeLimitedStreamTests.cs b/src/Middleware/RequestDecompression/test/SizeLimitedStreamTests.cs
new file mode 100644
index 0000000000..a4e086abfb
--- /dev/null
+++ b/src/Middleware/RequestDecompression/test/SizeLimitedStreamTests.cs
@@ -0,0 +1,107 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace Microsoft.AspNetCore.RequestDecompression.Tests;
+
+public class SizeLimitedStreamTests
+{
+ [Fact]
+ public void Ctor_NullInnerStream_Throws()
+ {
+ // Arrange
+ Stream innerStream = null;
+
+ // Act + Assert
+ Assert.Throws<ArgumentNullException>(() =>
+ {
+ using var sizeLimitedStream = new SizeLimitedStream(innerStream, 1);
+ });
+ }
+
+ [Theory]
+ [InlineData(true)]
+ [InlineData(false)]
+ public async Task ReadAsync_InnerStreamExceedsSizeLimit_Throws(bool exceedsLimit)
+ {
+ // Arrange
+ var sizeLimit = 10;
+ var bytes = new byte[sizeLimit + (exceedsLimit ? 1 : 0)];
+
+ using var innerStream = new MemoryStream(bytes);
+ using var sizeLimitedStream = new SizeLimitedStream(innerStream, sizeLimit);
+
+ var buffer = new byte[bytes.Length];
+
+ // Act
+ var exception = await Record.ExceptionAsync(async () =>
+ {
+ while (await sizeLimitedStream.ReadAsync(buffer) > 0) { }
+ });
+
+ // Assert
+ AssertStreamReadingException(exception, exceedsLimit);
+ }
+
+ [Theory]
+ [InlineData(true)]
+ [InlineData(false)]
+ public void Read_InnerStreamExceedsSizeLimit_Throws(bool exceedsLimit)
+ {
+ // Arrange
+ var sizeLimit = 10;
+ var bytes = new byte[sizeLimit + (exceedsLimit ? 1 : 0)];
+
+ using var innerStream = new MemoryStream(bytes);
+ using var sizeLimitedStream = new SizeLimitedStream(innerStream, sizeLimit);
+
+ var buffer = new byte[bytes.Length];
+
+ // Act
+ var exception = Record.Exception(() =>
+ {
+ while (sizeLimitedStream.Read(buffer, 0, buffer.Length) > 0) { }
+ });
+
+ // Assert
+ AssertStreamReadingException(exception, exceedsLimit);
+ }
+
+ [Theory]
+ [InlineData(true)]
+ [InlineData(false)]
+ public void BeginRead_InnerStreamExceedsSizeLimit_Throws(bool exceedsLimit)
+ {
+ // Arrange
+ var sizeLimit = 10;
+ var bytes = new byte[sizeLimit + (exceedsLimit ? 1 : 0)];
+
+ using var innerStream = new MemoryStream(bytes);
+ using var sizeLimitedStream = new SizeLimitedStream(innerStream, sizeLimit);
+
+ var buffer = new byte[bytes.Length];
+
+ // Act
+ var exception = Record.Exception(() =>
+ {
+ var asyncResult = sizeLimitedStream.BeginRead(buffer, 0, buffer.Length, (o) => { }, null);
+ sizeLimitedStream.EndRead(asyncResult);
+ });
+
+ // Assert
+ AssertStreamReadingException(exception, exceedsLimit);
+ }
+
+ private static void AssertStreamReadingException(Exception exception, bool exceedsLimit)
+ {
+ if (exceedsLimit)
+ {
+ Assert.NotNull(exception);
+ Assert.IsAssignableFrom<InvalidOperationException>(exception);
+ Assert.Equal("The maximum number of bytes have been read.", exception.Message);
+ }
+ else
+ {
+ Assert.Null(exception);
+ }
+ }
+}
diff --git a/src/Middleware/Spa/SpaProxy/src/SpaHostingStartup.cs b/src/Middleware/Spa/SpaProxy/src/SpaHostingStartup.cs
index 0bb6e4c8cb..65ea917072 100644
--- a/src/Middleware/Spa/SpaProxy/src/SpaHostingStartup.cs
+++ b/src/Middleware/Spa/SpaProxy/src/SpaHostingStartup.cs
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.Diagnostics.CodeAnalysis;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
@@ -24,9 +25,16 @@ internal sealed class SpaHostingStartup : IHostingStartup
.Build();
services.AddSingleton<SpaProxyLaunchManager>();
- services.Configure<SpaDevelopmentServerOptions>(configuration.GetSection("SpaProxyServer"));
+ ConfigureOptions<SpaDevelopmentServerOptions>(services, configuration.GetSection("SpaProxyServer"));
services.TryAddEnumerable(ServiceDescriptor.Singleton<IStartupFilter, SpaProxyStartupFilter>());
}
});
+
+ [UnconditionalSuppressMessageAttribute("Trimming", "IL2026", Justification = "Configuration object's public properties are preserved.")]
+ static void ConfigureOptions<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] T>(IServiceCollection services, IConfigurationSection section)
+ where T : class
+ {
+ services.Configure<T>(section);
+ }
}
}
diff --git a/src/Mvc/Mvc.Core/src/DisableRequestSizeLimitAttribute.cs b/src/Mvc/Mvc.Core/src/DisableRequestSizeLimitAttribute.cs
index 456ccaf3fc..1128509016 100644
--- a/src/Mvc/Mvc.Core/src/DisableRequestSizeLimitAttribute.cs
+++ b/src/Mvc/Mvc.Core/src/DisableRequestSizeLimitAttribute.cs
@@ -1,6 +1,7 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using Microsoft.AspNetCore.Http.Metadata;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.DependencyInjection;
@@ -9,8 +10,12 @@ namespace Microsoft.AspNetCore.Mvc;
/// <summary>
/// Disables the request body size limit.
/// </summary>
+/// <remarks>
+/// Disabling the request body size limit can be a security concern in regards to uncontrolled
+/// resource consumption, particularly if the request body is being buffered.
+/// </remarks>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
-public class DisableRequestSizeLimitAttribute : Attribute, IFilterFactory, IOrderedFilter
+public class DisableRequestSizeLimitAttribute : Attribute, IFilterFactory, IOrderedFilter, IRequestSizeLimitMetadata
{
/// <summary>
/// Gets the order value for determining the order of execution of filters. Filters execute in
@@ -39,4 +44,7 @@ public class DisableRequestSizeLimitAttribute : Attribute, IFilterFactory, IOrde
var filter = serviceProvider.GetRequiredService<DisableRequestSizeLimitFilter>();
return filter;
}
+
+ /// <inheritdoc />
+ long? IRequestSizeLimitMetadata.MaxRequestBodySize => null;
}
diff --git a/src/Mvc/Mvc.Core/src/RequestSizeLimitAttribute.cs b/src/Mvc/Mvc.Core/src/RequestSizeLimitAttribute.cs
index 15c69a6131..63b79fb23c 100644
--- a/src/Mvc/Mvc.Core/src/RequestSizeLimitAttribute.cs
+++ b/src/Mvc/Mvc.Core/src/RequestSizeLimitAttribute.cs
@@ -1,6 +1,7 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using Microsoft.AspNetCore.Http.Metadata;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.DependencyInjection;
@@ -10,7 +11,7 @@ namespace Microsoft.AspNetCore.Mvc;
/// Sets the request body size limit to the specified size.
/// </summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
-public class RequestSizeLimitAttribute : Attribute, IFilterFactory, IOrderedFilter
+public class RequestSizeLimitAttribute : Attribute, IFilterFactory, IOrderedFilter, IRequestSizeLimitMetadata
{
private readonly long _bytes;
@@ -51,4 +52,7 @@ public class RequestSizeLimitAttribute : Attribute, IFilterFactory, IOrderedFilt
filter.Bytes = _bytes;
return filter;
}
+
+ /// <inheritdoc />
+ long? IRequestSizeLimitMetadata.MaxRequestBodySize => _bytes;
}
diff --git a/src/Mvc/test/Mvc.FunctionalTests/SimpleWithWebApplicationBuilderTests.cs b/src/Mvc/test/Mvc.FunctionalTests/SimpleWithWebApplicationBuilderTests.cs
index 3a75cf8a14..71e44a3142 100644
--- a/src/Mvc/test/Mvc.FunctionalTests/SimpleWithWebApplicationBuilderTests.cs
+++ b/src/Mvc/test/Mvc.FunctionalTests/SimpleWithWebApplicationBuilderTests.cs
@@ -7,7 +7,6 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
-using Xunit.Abstractions;
namespace Microsoft.AspNetCore.Mvc.FunctionalTests;
@@ -15,15 +14,13 @@ public class SimpleWithWebApplicationBuilderTests : IClassFixture<MvcTestFixture
{
private readonly MvcTestFixture<SimpleWebSiteWithWebApplicationBuilder.Program> _fixture;
- public SimpleWithWebApplicationBuilderTests(MvcTestFixture<SimpleWebSiteWithWebApplicationBuilder.Program> fixture, ITestOutputHelper helper)
+ public SimpleWithWebApplicationBuilderTests(MvcTestFixture<SimpleWebSiteWithWebApplicationBuilder.Program> fixture)
{
_fixture = fixture;
- Helper = helper;
Client = _fixture.CreateDefaultClient();
}
public HttpClient Client { get; }
- public ITestOutputHelper Helper { get; }
[Fact]
public async Task HelloWorld()
@@ -145,21 +142,6 @@ public class SimpleWithWebApplicationBuilderTests : IClassFixture<MvcTestFixture
}
[Fact]
- public async Task Get_ConfigDebugView()
- {
- // Arrange
- using var client = new WebApplicationFactory<SimpleWebSiteWithWebApplicationBuilder.Program>().CreateClient();
-
- // Act
- var content = await client.GetStringAsync("http://localhost/config");
-
- Helper.WriteLine(content);
-
- // Assert
- Assert.NotEmpty(content);
- }
-
- [Fact]
public async Task Configuration_Can_Be_Overridden()
{
// Arrange
diff --git a/src/Mvc/test/WebSites/SimpleWebSiteWithWebApplicationBuilder/Program.cs b/src/Mvc/test/WebSites/SimpleWebSiteWithWebApplicationBuilder/Program.cs
index 34d0b44ae1..eed2be0302 100644
--- a/src/Mvc/test/WebSites/SimpleWebSiteWithWebApplicationBuilder/Program.cs
+++ b/src/Mvc/test/WebSites/SimpleWebSiteWithWebApplicationBuilder/Program.cs
@@ -36,10 +36,6 @@ app.MapGet("/many-results", (int id) =>
app.MapGet("/problem", () => Results.Problem("Some problem"));
-app.MapGet("/config", (IConfiguration config, HttpContext context) => {
- return context.Response.WriteAsync(((IConfigurationRoot)config).GetDebugView());
-});
-
app.MapGet("/environment", (IHostEnvironment environment) => environment.EnvironmentName);
app.MapGet("/webroot", (IWebHostEnvironment environment) => environment.WebRootPath);
diff --git a/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets b/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets
index 70c0c0d8e5..fee2679a21 100644
--- a/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets
+++ b/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets
@@ -2,7 +2,7 @@
<ItemGroup>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>DotNetEfFullPath</_Parameter1>
- <_Parameter2>$([MSBuild]::EnsureTrailingSlash('$(NuGetPackageRoot)'))dotnet-ef/$(DotnetEfVersion)/tools/netcoreapp3.1/any/dotnet-ef.dll</_Parameter2>
+ <_Parameter2>$([MSBuild]::EnsureTrailingSlash('$(NuGetPackageRoot)'))dotnet-ef/$(DotnetEfVersion)/tools/net6.0/any/dotnet-ef.dll</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>TestPackageRestorePath</_Parameter1>
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/localize/templatestrings.en.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/localize/templatestrings.en.json
index 24cfab2ca6..4248d9a49b 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/localize/templatestrings.en.json
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/localize/templatestrings.en.json
@@ -23,10 +23,10 @@
"symbols/UserSecretsId/description": "The ID to use for secrets (use with OrgReadAccess or Individual auth).",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
- "symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used).",
+ "symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualB2C or OrganizationalAuth is used).",
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
- "symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used).",
- "symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.",
+ "symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualB2C or OrganizationalAuth is used).",
+ "symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.",
"symbols/UseLocalDB/description": "Whether to use LocalDB instead of SQLite. This option only applies if --auth Individual or --auth IndividualB2C is specified.",
"symbols/Framework/description": "The target framework for the project.",
"symbols/Framework/choices/net7.0/description": "Target net7.0",
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/template.json
index 0189a641b7..e6437654ec 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/template.json
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/template.json
@@ -341,7 +341,7 @@
"kestrelHttpsPort": {
"type": "parameter",
"datatype": "integer",
- "description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used)."
+ "description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualB2C or OrganizationalAuth is used)."
},
"kestrelHttpsPortGenerated": {
"type": "generated",
@@ -381,7 +381,7 @@
"iisHttpsPort": {
"type": "parameter",
"datatype": "integer",
- "description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used)."
+ "description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualB2C or OrganizationalAuth is used)."
},
"iisHttpsPortGenerated": {
"type": "generated",
@@ -434,13 +434,13 @@
},
"RequiresHttps": {
"type": "computed",
- "value": "(OrganizationalAuth || IndividualAuth || !NoHttps)"
+ "value": "(OrganizationalAuth || IndividualB2C || !NoHttps)"
},
"NoHttps": {
"type": "parameter",
"datatype": "bool",
"defaultValue": "false",
- "description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth."
+ "description": "Whether to turn off HTTPS. This option only applies if IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth."
},
"UseLocalDB": {
"type": "parameter",
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Pages/_Host.cshtml b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Pages/_Host.cshtml
index 132aad8a77..5c1b296fe3 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Pages/_Host.cshtml
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Pages/_Host.cshtml
@@ -12,6 +12,7 @@
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
<link href="css/site.css" rel="stylesheet" />
<link href="BlazorServerWeb-CSharp.styles.css" rel="stylesheet" />
+ <link rel="icon" type="image/png" href="favicon.png"/>
<component type="typeof(HeadOutlet)" render-mode="ServerPrerendered" />
</head>
<body>
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Properties/launchSettings.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Properties/launchSettings.json
index 81462d5587..568f4bc966 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Properties/launchSettings.json
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Properties/launchSettings.json
@@ -17,19 +17,28 @@
}
},
"profiles": {
- "BlazorServerWeb-CSharp": {
+ //#if(!RequiresHttps)
+ "http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
- //#if(RequiresHttps)
- "applicationUrl": "https://localhost:5001;http://localhost:5000",
- //#else
"applicationUrl": "http://localhost:5000",
- //#endif
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
+ //#endif
+ //#if(!NoHttps)
+ "https": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "applicationUrl": "https://localhost:5001;http://localhost:5000",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ //#endif
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/wwwroot/favicon.ico b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/wwwroot/favicon.ico
deleted file mode 100644
index 63e859b476..0000000000
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/wwwroot/favicon.ico
+++ /dev/null
Binary files differ
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/wwwroot/favicon.png b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/wwwroot/favicon.png
new file mode 100644
index 0000000000..8422b59695
--- /dev/null
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/wwwroot/favicon.png
Binary files differ
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/favicon.ico b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/favicon.ico
deleted file mode 100644
index 63e859b476..0000000000
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/favicon.ico
+++ /dev/null
Binary files differ
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/favicon.png b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/favicon.png
new file mode 100644
index 0000000000..8422b59695
--- /dev/null
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/favicon.png
Binary files differ
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/index.html b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/index.html
index fe965c6249..eeae5479bc 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/index.html
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/index.html
@@ -8,6 +8,7 @@
<base href="/" />
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="css/app.css" rel="stylesheet" />
+ <link rel="icon" type="image/png" href="favicon.png" />
<!--#if (Hosted) -->
<link href="ComponentsWebAssembly-CSharp.Client.styles.css" rel="stylesheet" />
<!--#else -->
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/Properties/launchSettings.json b/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/Properties/launchSettings.json
index e341bf4f8f..cb3a322a30 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/Properties/launchSettings.json
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/Properties/launchSettings.json
@@ -17,19 +17,26 @@
}
},
"profiles": {
- "Company.WebApplication1": {
+ "http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
- //#if(NoHttps)
"applicationUrl": "http://localhost:5000",
- //#else
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ //#if(!NoHttps)
+ "https": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
"applicationUrl": "https://localhost:5001;http://localhost:5000",
- //#endif
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
+ //#endif
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-FSharp/Properties/launchSettings.json b/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-FSharp/Properties/launchSettings.json
index 8ac0e66ef4..4f1ea4d3ab 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-FSharp/Properties/launchSettings.json
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-FSharp/Properties/launchSettings.json
@@ -12,19 +12,26 @@
}
},
"profiles": {
- "Company.WebApplication1": {
+ "http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
- //#if(NoHttps)
"applicationUrl": "http://localhost:5000",
- //#else
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ //#if(!NoHttps)
+ "https": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
"applicationUrl": "https://localhost:5001;http://localhost:5000",
- //#endif
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
+ //#endif
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Properties/launchSettings.json b/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Properties/launchSettings.json
index e27b596327..01dd5f0d40 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Properties/launchSettings.json
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Properties/launchSettings.json
@@ -1,10 +1,19 @@
{
"profiles": {
- "GrpcService-CSharp": {
+ "http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
- "applicationUrl": "http://localhost:5000;https://localhost:5001",
+ "applicationUrl": "http://localhost:5000",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "https": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": false,
+ "applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/localize/templatestrings.en.json b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/localize/templatestrings.en.json
index d9e25f82e1..98d88c50b4 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/localize/templatestrings.en.json
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/localize/templatestrings.en.json
@@ -24,10 +24,10 @@
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json in the generated template.",
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
- "symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used).",
+ "symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualB2C or OrganizationalAuth is used).",
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
- "symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used).",
- "symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.",
+ "symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualB2C or OrganizationalAuth is used).",
+ "symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.",
"symbols/UseLocalDB/description": "Whether to use LocalDB instead of SQLite. This option only applies if --auth Individual or --auth IndividualB2C is specified.",
"symbols/Framework/description": "The target framework for the project.",
"symbols/Framework/choices/net7.0/description": "Target net7.0",
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/template.json
index 3f42794ce9..7953b981f5 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/template.json
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/template.json
@@ -263,7 +263,7 @@
"kestrelHttpsPort": {
"type": "parameter",
"datatype": "integer",
- "description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used)."
+ "description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualB2C or OrganizationalAuth is used)."
},
"kestrelHttpsPortGenerated": {
"type": "generated",
@@ -303,7 +303,7 @@
"iisHttpsPort": {
"type": "parameter",
"datatype": "integer",
- "description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used)."
+ "description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualB2C or OrganizationalAuth is used)."
},
"iisHttpsPortGenerated": {
"type": "generated",
@@ -356,13 +356,13 @@
},
"RequiresHttps": {
"type": "computed",
- "value": "(OrganizationalAuth || IndividualAuth || !NoHttps)"
+ "value": "(OrganizationalAuth || IndividualB2C || !NoHttps)"
},
"NoHttps": {
"type": "parameter",
"datatype": "bool",
"defaultValue": "false",
- "description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth."
+ "description": "Whether to turn off HTTPS. This option only applies if IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth."
},
"UseLocalDB": {
"type": "parameter",
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Properties/launchSettings.json b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Properties/launchSettings.json
index 316f54a0fe..4c3cf22695 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Properties/launchSettings.json
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Properties/launchSettings.json
@@ -17,19 +17,28 @@
}
},
"profiles": {
- "Company.WebApplication1": {
+ //#if(!RequiresHttps)
+ "http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
- //#if(RequiresHttps)
- "applicationUrl": "https://localhost:5001;http://localhost:5000",
- //#else
"applicationUrl": "http://localhost:5000",
- //#endif
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
+ //#endif
+ //#if(!NoHttps)
+ "https": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "applicationUrl": "https://localhost:5001;http://localhost:5000",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ //#endif
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/.template.config/localize/templatestrings.en.json b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/.template.config/localize/templatestrings.en.json
index 4f01b0e182..d246072ffa 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/.template.config/localize/templatestrings.en.json
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/.template.config/localize/templatestrings.en.json
@@ -23,10 +23,10 @@
"symbols/UserSecretsId/description": "The ID to use for secrets (use with OrgReadAccess or Individual auth).",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
- "symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used).",
+ "symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualB2C or OrganizationalAuth is used).",
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
- "symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used).",
- "symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.",
+ "symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualB2C or OrganizationalAuth is used).",
+ "symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.",
"symbols/UseLocalDB/description": "Whether to use LocalDB instead of SQLite. This option only applies if --auth Individual or --auth IndividualB2C is specified.",
"symbols/Framework/description": "The target framework for the project.",
"symbols/Framework/choices/net7.0/description": "Target net7.0",
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/.template.config/template.json
index a2af2cbbf6..4a67c35570 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/.template.config/template.json
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/.template.config/template.json
@@ -253,7 +253,7 @@
"kestrelHttpsPort": {
"type": "parameter",
"datatype": "integer",
- "description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used)."
+ "description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualB2C or OrganizationalAuth is used)."
},
"kestrelHttpsPortGenerated": {
"type": "generated",
@@ -293,7 +293,7 @@
"iisHttpsPort": {
"type": "parameter",
"datatype": "integer",
- "description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used)."
+ "description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualB2C or OrganizationalAuth is used)."
},
"iisHttpsPortGenerated": {
"type": "generated",
@@ -346,13 +346,13 @@
},
"RequiresHttps": {
"type": "computed",
- "value": "(OrganizationalAuth || IndividualAuth || !NoHttps)"
+ "value": "(OrganizationalAuth || IndividualB2C || !NoHttps)"
},
"NoHttps": {
"type": "parameter",
"datatype": "bool",
"defaultValue": "false",
- "description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth."
+ "description": "Whether to turn off HTTPS. This option only applies if IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth."
},
"UseLocalDB": {
"type": "parameter",
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Properties/launchSettings.json b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Properties/launchSettings.json
index 316f54a0fe..4c3cf22695 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Properties/launchSettings.json
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Properties/launchSettings.json
@@ -17,19 +17,28 @@
}
},
"profiles": {
- "Company.WebApplication1": {
+ //#if(!RequiresHttps)
+ "http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
- //#if(RequiresHttps)
- "applicationUrl": "https://localhost:5001;http://localhost:5000",
- //#else
"applicationUrl": "http://localhost:5000",
- //#endif
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
+ //#endif
+ //#if(!NoHttps)
+ "https": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "applicationUrl": "https://localhost:5001;http://localhost:5000",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ //#endif
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/Properties/launchSettings.json b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/Properties/launchSettings.json
index e341bf4f8f..cb3a322a30 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/Properties/launchSettings.json
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/Properties/launchSettings.json
@@ -17,19 +17,26 @@
}
},
"profiles": {
- "Company.WebApplication1": {
+ "http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
- //#if(NoHttps)
"applicationUrl": "http://localhost:5000",
- //#else
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ //#if(!NoHttps)
+ "https": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
"applicationUrl": "https://localhost:5001;http://localhost:5000",
- //#endif
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
+ //#endif
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/localize/templatestrings.en.json b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/localize/templatestrings.en.json
index 34a1dd0167..b613633e73 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/localize/templatestrings.en.json
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/localize/templatestrings.en.json
@@ -18,10 +18,10 @@
"symbols/UserSecretsId/description": "The ID to use for secrets (use with OrgReadAccess or Individual auth).",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json in the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
- "symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used).",
+ "symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualB2C or OrganizationalAuth is used).",
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
- "symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used).",
- "symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.",
+ "symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualB2C or OrganizationalAuth is used).",
+ "symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.",
"symbols/UseLocalDB/description": "Whether to use LocalDB instead of SQLite. This option only applies if --auth Individual or --auth IndividualB2C is specified.",
"symbols/UseMinimalAPIs/description": "Whether to use minimal APIs instead of controllers.",
"symbols/Framework/description": "The target framework for the project.",
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/template.json
index e36961ed63..1d5ba93191 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/template.json
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/template.json
@@ -209,7 +209,7 @@
"kestrelHttpsPort": {
"type": "parameter",
"datatype": "integer",
- "description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used)."
+ "description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualB2C or OrganizationalAuth is used)."
},
"kestrelHttpsPortGenerated": {
"type": "generated",
@@ -249,7 +249,7 @@
"iisHttpsPort": {
"type": "parameter",
"datatype": "integer",
- "description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used)."
+ "description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualB2C or OrganizationalAuth is used)."
},
"iisHttpsPortGenerated": {
"type": "generated",
@@ -294,13 +294,13 @@
},
"RequiresHttps": {
"type": "computed",
- "value": "(OrganizationalAuth || IndividualAuth || !NoHttps)"
+ "value": "(OrganizationalAuth || IndividualB2C || !NoHttps)"
},
"NoHttps": {
"type": "parameter",
"datatype": "bool",
"defaultValue": "false",
- "description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth."
+ "description": "Whether to turn off HTTPS. This option only applies if IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth."
},
"UseLocalDB": {
"type": "parameter",
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Properties/launchSettings.json b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Properties/launchSettings.json
index 2ab450749e..eb19365753 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Properties/launchSettings.json
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Properties/launchSettings.json
@@ -18,7 +18,8 @@
}
},
"profiles": {
- "Company.WebApplication1": {
+ //#if(!RequiresHttps)
+ "http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
@@ -27,15 +28,28 @@
//#else
"launchUrl": "weatherforecast",
//#endif
- //#if(RequiresHttps)
- "applicationUrl": "https://localhost:5001;http://localhost:5000",
- //#else
"applicationUrl": "http://localhost:5000",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ //#endif
+ //#if(!NoHttps)
+ "https": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ //#if(EnableOpenAPI)
+ "launchUrl": "swagger",
+ //#else
+ "launchUrl": "weatherforecast",
//#endif
+ "applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
+ //#endif
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/.template.config/localize/templatestrings.en.json b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/.template.config/localize/templatestrings.en.json
index 10dfdafb04..6506f52fae 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/.template.config/localize/templatestrings.en.json
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/.template.config/localize/templatestrings.en.json
@@ -4,13 +4,13 @@
"description": "A project template for creating an ASP.NET Core application with an example Controller for a RESTful HTTP service. This template can also be used for ASP.NET Core MVC Views and Controllers.",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
- "symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used).",
+ "symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json.",
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
- "symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used).",
+ "symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json.",
"symbols/Framework/description": "The target framework for the project.",
"symbols/Framework/choices/net7.0/description": "Target net7.0",
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
- "symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.",
+ "symbols/NoHttps/description": "Whether to turn off HTTPS.",
"postActions/restore/description": "Restore NuGet packages required by this project.",
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'"
} \ No newline at end of file
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/.template.config/template.json
index 0ae13400e2..bca07eaf4d 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/.template.config/template.json
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/.template.config/template.json
@@ -61,7 +61,7 @@
"kestrelHttpsPort": {
"type": "parameter",
"datatype": "integer",
- "description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used)."
+ "description": "Port number to use for the HTTPS endpoint in launchSettings.json."
},
"kestrelHttpsPortGenerated": {
"type": "generated",
@@ -101,7 +101,7 @@
"iisHttpsPort": {
"type": "parameter",
"datatype": "integer",
- "description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used)."
+ "description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json."
},
"iisHttpsPortGenerated": {
"type": "generated",
@@ -151,7 +151,7 @@
"type": "parameter",
"datatype": "bool",
"defaultValue": "false",
- "description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth."
+ "description": "Whether to turn off HTTPS."
}
},
"primaryOutputs": [
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/Properties/launchSettings.json b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/Properties/launchSettings.json
index e974bfdb61..94f27bca91 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/Properties/launchSettings.json
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/Properties/launchSettings.json
@@ -18,20 +18,36 @@
}
},
"profiles": {
- "Company.WebApplication1": {
+ "http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
+ //#if(EnableOpenAPI)
+ "launchUrl": "swagger",
+ //#else
"launchUrl": "weatherforecast",
- //#if(NoHttps)
+ //#endif
"applicationUrl": "http://localhost:5000",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ //#if(!NoHttps)
+ "https": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ //#if(EnableOpenAPI)
+ "launchUrl": "swagger",
//#else
- "applicationUrl": "https://localhost:5001;http://localhost:5000",
+ "launchUrl": "weatherforecast",
//#endif
+ "applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
+ //#endif
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
diff --git a/src/ProjectTemplates/scripts/Test-Template.ps1 b/src/ProjectTemplates/scripts/Test-Template.ps1
index 1774b47735..ca0399d220 100644
--- a/src/ProjectTemplates/scripts/Test-Template.ps1
+++ b/src/ProjectTemplates/scripts/Test-Template.ps1
@@ -65,7 +65,7 @@ function Test-Template($templateName, $templateArgs, $templateNupkg, $isBlazorWa
Push-Location Server
}
if ($templateArgs -match '-au') {
- dotnet.exe ef migrations add mvc
+ dotnet.exe ef migrations add Initial
}
dotnet.exe publish --configuration Release
Set-Location .\bin\Release\net7.0\publish
diff --git a/src/ProjectTemplates/test/template-baselines.json b/src/ProjectTemplates/test/template-baselines.json
index 9dd3b98d04..f2a584d6fd 100644
--- a/src/ProjectTemplates/test/template-baselines.json
+++ b/src/ProjectTemplates/test/template-baselines.json
@@ -1369,7 +1369,7 @@
"Shared/NavMenu.razor",
"Shared/NavMenu.razor.css",
"Shared/SurveyPrompt.razor",
- "wwwroot/favicon.ico",
+ "wwwroot/favicon.png",
"wwwroot/css/site.css",
"wwwroot/css/bootstrap/bootstrap.min.css",
"wwwroot/css/bootstrap/bootstrap.min.css.map",
@@ -1408,7 +1408,7 @@
"Shared/NavMenu.razor",
"Shared/NavMenu.razor.css",
"Shared/SurveyPrompt.razor",
- "wwwroot/favicon.ico",
+ "wwwroot/favicon.png",
"wwwroot/css/site.css",
"wwwroot/css/bootstrap/bootstrap.min.css",
"wwwroot/css/bootstrap/bootstrap.min.css.map",
@@ -1447,7 +1447,7 @@
"Shared/NavMenu.razor",
"Shared/NavMenu.razor.css",
"Shared/SurveyPrompt.razor",
- "wwwroot/favicon.ico",
+ "wwwroot/favicon.png",
"wwwroot/css/site.css",
"wwwroot/css/bootstrap/bootstrap.min.css",
"wwwroot/css/bootstrap/bootstrap.min.css.map",
@@ -1485,7 +1485,7 @@
"Shared/NavMenu.razor",
"Shared/NavMenu.razor.css",
"Shared/SurveyPrompt.razor",
- "wwwroot/favicon.ico",
+ "wwwroot/favicon.png",
"wwwroot/css/site.css",
"wwwroot/css/bootstrap/bootstrap.min.css",
"wwwroot/css/bootstrap/bootstrap.min.css.map",
@@ -1524,7 +1524,7 @@
"Shared/NavMenu.razor",
"Shared/NavMenu.razor.css",
"Shared/SurveyPrompt.razor",
- "wwwroot/favicon.ico",
+ "wwwroot/favicon.png",
"wwwroot/css/site.css",
"wwwroot/css/bootstrap/bootstrap.min.css",
"wwwroot/css/bootstrap/bootstrap.min.css.map",
@@ -1563,7 +1563,7 @@
"Shared/NavMenu.razor",
"Shared/NavMenu.razor.css",
"Shared/SurveyPrompt.razor",
- "wwwroot/favicon.ico",
+ "wwwroot/favicon.png",
"wwwroot/css/site.css",
"wwwroot/css/bootstrap/bootstrap.min.css",
"wwwroot/css/bootstrap/bootstrap.min.css.map",
diff --git a/src/Security/Authentication/Cookies/src/CookieAuthenticationHandler.cs b/src/Security/Authentication/Cookies/src/CookieAuthenticationHandler.cs
index 7cfa4f94bb..826ff9e6ff 100644
--- a/src/Security/Authentication/Cookies/src/CookieAuthenticationHandler.cs
+++ b/src/Security/Authentication/Cookies/src/CookieAuthenticationHandler.cs
@@ -158,7 +158,7 @@ public class CookieAuthenticationHandler : SignInAuthenticationHandler<CookieAut
return AuthenticateResult.Fail("SessionId missing");
}
// Only store _sessionKey if it matches an existing session. Otherwise we'll create a new one.
- ticket = await Options.SessionStore.RetrieveAsync(claim.Value, Context.RequestAborted);
+ ticket = await Options.SessionStore.RetrieveAsync(claim.Value, Context, Context.RequestAborted);
if (ticket == null)
{
return AuthenticateResult.Fail("Identity missing in session store");
@@ -173,7 +173,7 @@ public class CookieAuthenticationHandler : SignInAuthenticationHandler<CookieAut
{
if (Options.SessionStore != null)
{
- await Options.SessionStore.RemoveAsync(_sessionKey!, Context.RequestAborted);
+ await Options.SessionStore.RemoveAsync(_sessionKey!, Context, Context.RequestAborted);
}
return AuthenticateResult.Fail("Ticket expired");
}
@@ -247,7 +247,7 @@ public class CookieAuthenticationHandler : SignInAuthenticationHandler<CookieAut
if (Options.SessionStore != null && _sessionKey != null)
{
- await Options.SessionStore.RenewAsync(_sessionKey, ticket, Context.RequestAborted);
+ await Options.SessionStore.RenewAsync(_sessionKey, ticket, Context, Context.RequestAborted);
var principal = new ClaimsPrincipal(
new ClaimsIdentity(
new[] { new Claim(SessionIdClaim, _sessionKey, ClaimValueTypes.String, Options.ClaimsIssuer) },
@@ -269,7 +269,7 @@ public class CookieAuthenticationHandler : SignInAuthenticationHandler<CookieAut
cookieValue,
cookieOptions);
- await ApplyHeaders(shouldRedirectToReturnUrl: false, properties: properties);
+ await ApplyHeaders(shouldRedirect: false, shouldHonorReturnUrlParameter: false, properties: properties);
}
}
@@ -328,11 +328,11 @@ public class CookieAuthenticationHandler : SignInAuthenticationHandler<CookieAut
if (_sessionKey != null)
{
// Renew the ticket in cases of multiple requests see: https://github.com/dotnet/aspnetcore/issues/22135
- await Options.SessionStore.RenewAsync(_sessionKey, ticket, Context.RequestAborted);
+ await Options.SessionStore.RenewAsync(_sessionKey, ticket, Context, Context.RequestAborted);
}
else
{
- _sessionKey = await Options.SessionStore.StoreAsync(ticket, Context.RequestAborted);
+ _sessionKey = await Options.SessionStore.StoreAsync(ticket, Context, Context.RequestAborted);
}
var principal = new ClaimsPrincipal(
@@ -359,9 +359,9 @@ public class CookieAuthenticationHandler : SignInAuthenticationHandler<CookieAut
await Events.SignedIn(signedInContext);
- // Only redirect on the login path
- var shouldRedirect = Options.LoginPath.HasValue && OriginalPath == Options.LoginPath;
- await ApplyHeaders(shouldRedirect, signedInContext.Properties);
+ // Only honor the ReturnUrl query string parameter on the login path
+ var shouldHonorReturnUrlParameter = Options.LoginPath.HasValue && OriginalPath == Options.LoginPath;
+ await ApplyHeaders(shouldRedirect: true, shouldHonorReturnUrlParameter, signedInContext.Properties);
Logger.AuthenticationSchemeSignedIn(Scheme.Name);
}
@@ -378,7 +378,7 @@ public class CookieAuthenticationHandler : SignInAuthenticationHandler<CookieAut
var cookieOptions = BuildCookieOptions();
if (Options.SessionStore != null && _sessionKey != null)
{
- await Options.SessionStore.RemoveAsync(_sessionKey, Context.RequestAborted);
+ await Options.SessionStore.RemoveAsync(_sessionKey, Context, Context.RequestAborted);
}
var context = new CookieSigningOutContext(
@@ -395,29 +395,29 @@ public class CookieAuthenticationHandler : SignInAuthenticationHandler<CookieAut
Options.Cookie.Name!,
context.CookieOptions);
- // Only redirect on the logout path
- var shouldRedirect = Options.LogoutPath.HasValue && OriginalPath == Options.LogoutPath;
- await ApplyHeaders(shouldRedirect, context.Properties);
+ // Only honor the ReturnUrl query string parameter on the logout path
+ var shouldHonorReturnUrlParameter = Options.LogoutPath.HasValue && OriginalPath == Options.LogoutPath;
+ await ApplyHeaders(shouldRedirect: true, shouldHonorReturnUrlParameter, context.Properties);
Logger.AuthenticationSchemeSignedOut(Scheme.Name);
}
- private async Task ApplyHeaders(bool shouldRedirectToReturnUrl, AuthenticationProperties properties)
+ private async Task ApplyHeaders(bool shouldRedirect, bool shouldHonorReturnUrlParameter, AuthenticationProperties properties)
{
Response.Headers.CacheControl = HeaderValueNoCacheNoStore;
Response.Headers.Pragma = HeaderValueNoCache;
Response.Headers.Expires = HeaderValueEpocDate;
- if (shouldRedirectToReturnUrl && Response.StatusCode == 200)
+ if (shouldRedirect && Response.StatusCode == 200)
{
// set redirect uri in order:
// 1. properties.RedirectUri
- // 2. query parameter ReturnUrlParameter
+ // 2. query parameter ReturnUrlParameter (if the request path matches the path set in the options)
//
// Absolute uri is not allowed if it is from query string as query string is not
// a trusted source.
var redirectUri = properties.RedirectUri;
- if (string.IsNullOrEmpty(redirectUri))
+ if (shouldHonorReturnUrlParameter && string.IsNullOrEmpty(redirectUri))
{
redirectUri = Request.Query[Options.ReturnUrlParameter];
if (string.IsNullOrEmpty(redirectUri) || !IsHostRelative(redirectUri))
diff --git a/src/Security/Authentication/Cookies/src/ITicketStore.cs b/src/Security/Authentication/Cookies/src/ITicketStore.cs
index 4bb1c5e6a6..633837a323 100644
--- a/src/Security/Authentication/Cookies/src/ITicketStore.cs
+++ b/src/Security/Authentication/Cookies/src/ITicketStore.cs
@@ -1,6 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using Microsoft.AspNetCore.Http;
+
namespace Microsoft.AspNetCore.Authentication.Cookies;
/// <summary>
@@ -26,6 +28,15 @@ public interface ITicketStore
Task<string> StoreAsync(AuthenticationTicket ticket, CancellationToken cancellationToken) => StoreAsync(ticket);
/// <summary>
+ /// Store the identity ticket and return the associated key.
+ /// </summary>
+ /// <param name="ticket">The identity information to store.</param>
+ /// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param>
+ /// <param name="cancellationToken">The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param>
+ /// <returns>The key that can be used to retrieve the identity later.</returns>
+ Task<string> StoreAsync(AuthenticationTicket ticket, HttpContext httpContext, CancellationToken cancellationToken) => StoreAsync(ticket, cancellationToken);
+
+ /// <summary>
/// Tells the store that the given identity should be updated.
/// </summary>
/// <param name="key"></param>
@@ -43,6 +54,16 @@ public interface ITicketStore
Task RenewAsync(string key, AuthenticationTicket ticket, CancellationToken cancellationToken) => RenewAsync(key, ticket);
/// <summary>
+ /// Tells the store that the given identity should be updated.
+ /// </summary>
+ /// <param name="key"></param>
+ /// <param name="ticket"></param>
+ /// <param name="httpContext"></param>
+ /// <param name="cancellationToken">The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param>
+ /// <returns></returns>
+ Task RenewAsync(string key, AuthenticationTicket ticket, HttpContext httpContext, CancellationToken cancellationToken) => RenewAsync(key, ticket, cancellationToken);
+
+ /// <summary>
/// Retrieves an identity from the store for the given key.
/// </summary>
/// <param name="key">The key associated with the identity.</param>
@@ -58,6 +79,15 @@ public interface ITicketStore
Task<AuthenticationTicket?> RetrieveAsync(string key, CancellationToken cancellationToken) => RetrieveAsync(key);
/// <summary>
+ /// Retrieves an identity from the store for the given key.
+ /// </summary>
+ /// <param name="key">The key associated with the identity.</param>
+ /// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param>
+ /// <param name="cancellationToken">The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param>
+ /// <returns>The identity associated with the given key, or <c>null</c> if not found.</returns>
+ Task<AuthenticationTicket?> RetrieveAsync(string key, HttpContext httpContext, CancellationToken cancellationToken) => RetrieveAsync(key, cancellationToken);
+
+ /// <summary>
/// Remove the identity associated with the given key.
/// </summary>
/// <param name="key">The key associated with the identity.</param>
@@ -71,4 +101,13 @@ public interface ITicketStore
/// <param name="cancellationToken">The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param>
/// <returns></returns>
Task RemoveAsync(string key, CancellationToken cancellationToken) => RemoveAsync(key);
+
+ /// <summary>
+ /// Remove the identity associated with the given key.
+ /// </summary>
+ /// <param name="key">The key associated with the identity.</param>
+ /// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param>
+ /// <param name="cancellationToken">The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param>
+ /// <returns></returns>
+ Task RemoveAsync(string key, HttpContext httpContext, CancellationToken cancellationToken) => RemoveAsync(key, cancellationToken);
}
diff --git a/src/Security/Authentication/Cookies/src/PublicAPI.Unshipped.txt b/src/Security/Authentication/Cookies/src/PublicAPI.Unshipped.txt
index 899d7d2843..656e195c1a 100644
--- a/src/Security/Authentication/Cookies/src/PublicAPI.Unshipped.txt
+++ b/src/Security/Authentication/Cookies/src/PublicAPI.Unshipped.txt
@@ -1,4 +1,8 @@
#nullable enable
*REMOVED*Microsoft.AspNetCore.Authentication.Cookies.PostConfigureCookieAuthenticationOptions.PostConfigure(string! name, Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationOptions! options) -> void
+Microsoft.AspNetCore.Authentication.Cookies.ITicketStore.RemoveAsync(string! key, Microsoft.AspNetCore.Http.HttpContext! httpContext, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task!
+Microsoft.AspNetCore.Authentication.Cookies.ITicketStore.RenewAsync(string! key, Microsoft.AspNetCore.Authentication.AuthenticationTicket! ticket, Microsoft.AspNetCore.Http.HttpContext! httpContext, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task!
+Microsoft.AspNetCore.Authentication.Cookies.ITicketStore.RetrieveAsync(string! key, Microsoft.AspNetCore.Http.HttpContext! httpContext, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Authentication.AuthenticationTicket?>!
+Microsoft.AspNetCore.Authentication.Cookies.ITicketStore.StoreAsync(Microsoft.AspNetCore.Authentication.AuthenticationTicket! ticket, Microsoft.AspNetCore.Http.HttpContext! httpContext, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task<string!>!
Microsoft.AspNetCore.Authentication.Cookies.PostConfigureCookieAuthenticationOptions.PostConfigure(string? name, Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationOptions! options) -> void
virtual Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationEvents.CheckSlidingExpiration(Microsoft.AspNetCore.Authentication.Cookies.CookieSlidingExpirationContext! context) -> System.Threading.Tasks.Task!
diff --git a/src/Security/Authentication/test/CookieTests.cs b/src/Security/Authentication/test/CookieTests.cs
index 13cbfc2024..27c225208e 100644
--- a/src/Security/Authentication/test/CookieTests.cs
+++ b/src/Security/Authentication/test/CookieTests.cs
@@ -1384,13 +1384,15 @@ public class CookieTests : SharedAuthenticationTests<CookieAuthenticationOptions
}
[Theory]
- [InlineData("/redirect_test")]
- [InlineData("http://example.com/redirect_to")]
- public async Task RedirectUriIsHoneredAfterSignin(string redirectUrl)
+ [InlineData("/redirect_test", "/loginpath")]
+ [InlineData("/redirect_test", "/testpath")]
+ [InlineData("http://example.com/redirect_to", "/loginpath")]
+ [InlineData("http://example.com/redirect_to", "/testpath")]
+ public async Task RedirectUriIsHonoredAfterSignin(string redirectUrl, string loginPath)
{
using var host = await CreateHost(o =>
{
- o.LoginPath = "/testpath";
+ o.LoginPath = loginPath;
o.Cookie.Name = "TestCookie";
},
async context =>
@@ -1408,7 +1410,29 @@ public class CookieTests : SharedAuthenticationTests<CookieAuthenticationOptions
}
[Fact]
- public async Task RedirectUriInQueryIsHoneredAfterSignin()
+ public async Task RedirectUriInQueryIsIgnoredAfterSigninForUnrecognizedEndpoints()
+ {
+ using var host = await CreateHost(o =>
+ {
+ o.LoginPath = "/loginpath";
+ o.ReturnUrlParameter = "return";
+ o.Cookie.Name = "TestCookie";
+ },
+ async context =>
+ {
+ await context.SignInAsync(
+ CookieAuthenticationDefaults.AuthenticationScheme,
+ new ClaimsPrincipal(new ClaimsIdentity(new GenericIdentity("Alice", CookieAuthenticationDefaults.AuthenticationScheme))));
+ });
+ using var server = host.GetTestServer();
+ var transaction = await SendAsync(server, "http://example.com/testpath?return=%2Fret_path_2");
+
+ Assert.NotEmpty(transaction.SetCookie);
+ Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode);
+ }
+
+ [Fact]
+ public async Task RedirectUriInQueryIsHonoredAfterSignin()
{
using var host = await CreateHost(o =>
{
diff --git a/src/Servers/Kestrel/Core/src/CoreStrings.resx b/src/Servers/Kestrel/Core/src/CoreStrings.resx
index c9f39d1da1..2dd65fc707 100644
--- a/src/Servers/Kestrel/Core/src/CoreStrings.resx
+++ b/src/Servers/Kestrel/Core/src/CoreStrings.resx
@@ -668,4 +668,13 @@ For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?l
<data name="Http3ControlStreamErrorInitializingOutbound" xml:space="preserve">
<value>Error initializing outbound control stream.</value>
</data>
-</root> \ No newline at end of file
+ <data name="Http3DatagramStatusMismatch" xml:space="preserve">
+ <value>HTTP/3 datagrams negotiation mismatch. Currently client has it '{clientStatus}' and server has it '{serverStatus}'</value>
+ </data>
+ <data name="Http3MethodMustBeConnectWhenUsingProtocolPseudoHeader" xml:space="preserve">
+ <value>Method must be CONNECT when using the :protocol pseudo-header.</value>
+ </data>
+ <data name="Http3MissingAuthorityOrPathPseudoHeaders" xml:space="preserve">
+ <value>The :authority and/or :path pseudo-headers are missing.</value>
+ </data>
+</root>
diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/HttpHeaders.Generated.cs b/src/Servers/Kestrel/Core/src/Internal/Http/HttpHeaders.Generated.cs
index 838b0463ab..9f46dd48d7 100644
--- a/src/Servers/Kestrel/Core/src/Internal/Http/HttpHeaders.Generated.cs
+++ b/src/Servers/Kestrel/Core/src/Internal/Http/HttpHeaders.Generated.cs
@@ -77,6 +77,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
Origin,
Path,
Pragma,
+ Protocol,
ProxyAuthenticate,
ProxyAuthorization,
ProxyConnection,
@@ -277,7 +278,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
internal partial class HttpHeaders
{
- private readonly static HashSet<string> _internedHeaderNames = new HashSet<string>(96, StringComparer.OrdinalIgnoreCase)
+ private readonly static HashSet<string> _internedHeaderNames = new HashSet<string>(97, StringComparer.OrdinalIgnoreCase)
{
HeaderNames.Accept,
HeaderNames.AcceptCharset,
@@ -338,6 +339,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
HeaderNames.Origin,
HeaderNames.Path,
HeaderNames.Pragma,
+ HeaderNames.Protocol,
HeaderNames.ProxyAuthenticate,
HeaderNames.ProxyAuthorization,
HeaderNames.ProxyConnection,
@@ -383,8 +385,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
private HeaderReferences _headers;
public bool HasConnection => (_bits & 0x2L) != 0;
- public bool HasCookie => (_bits & 0x20000L) != 0;
- public bool HasTransferEncoding => (_bits & 0x20000000000L) != 0;
+ public bool HasCookie => (_bits & 0x40000L) != 0;
+ public bool HasTransferEncoding => (_bits & 0x40000000000L) != 0;
public int HostCount => _headers._Host.Count;
@@ -508,14 +510,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
_headers._Path = value;
}
}
- public StringValues HeaderScheme
+ public StringValues HeaderProtocol
{
get
{
StringValues value = default;
if ((_bits & 0x80L) != 0)
{
- value = _headers._Scheme;
+ value = _headers._Protocol;
}
return value;
}
@@ -529,6 +531,30 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
_bits &= ~0x80L;
}
+ _headers._Protocol = value;
+ }
+ }
+ public StringValues HeaderScheme
+ {
+ get
+ {
+ StringValues value = default;
+ if ((_bits & 0x100L) != 0)
+ {
+ value = _headers._Scheme;
+ }
+ return value;
+ }
+ set
+ {
+ if (!StringValues.IsNullOrEmpty(value))
+ {
+ _bits |= 0x100L;
+ }
+ else
+ {
+ _bits &= ~0x100L;
+ }
_headers._Scheme = value;
}
}
@@ -537,7 +563,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
StringValues value = default;
- if ((_bits & 0x20000000000L) != 0)
+ if ((_bits & 0x40000000000L) != 0)
{
value = _headers._TransferEncoding;
}
@@ -547,11 +573,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (!StringValues.IsNullOrEmpty(value))
{
- _bits |= 0x20000000000L;
+ _bits |= 0x40000000000L;
}
else
{
- _bits &= ~0x20000000000L;
+ _bits &= ~0x40000000000L;
}
_headers._TransferEncoding = value;
}
@@ -690,7 +716,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._AcceptCharset;
- if ((_bits & 0x100L) != 0)
+ if ((_bits & 0x200L) != 0)
{
return value;
}
@@ -700,7 +726,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x100L;
+ var flag = 0x200L;
if (value.Count > 0)
{
_bits |= flag;
@@ -718,7 +744,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._AcceptEncoding;
- if ((_bits & 0x200L) != 0)
+ if ((_bits & 0x400L) != 0)
{
return value;
}
@@ -728,7 +754,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x200L;
+ var flag = 0x400L;
if (value.Count > 0)
{
_bits |= flag;
@@ -746,7 +772,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._AcceptLanguage;
- if ((_bits & 0x400L) != 0)
+ if ((_bits & 0x800L) != 0)
{
return value;
}
@@ -756,7 +782,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x400L;
+ var flag = 0x800L;
if (value.Count > 0)
{
_bits |= flag;
@@ -774,7 +800,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._AccessControlRequestHeaders;
- if ((_bits & 0x800L) != 0)
+ if ((_bits & 0x1000L) != 0)
{
return value;
}
@@ -784,7 +810,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x800L;
+ var flag = 0x1000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -802,7 +828,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._AccessControlRequestMethod;
- if ((_bits & 0x1000L) != 0)
+ if ((_bits & 0x2000L) != 0)
{
return value;
}
@@ -812,7 +838,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x1000L;
+ var flag = 0x2000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -830,7 +856,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._Authorization;
- if ((_bits & 0x2000L) != 0)
+ if ((_bits & 0x4000L) != 0)
{
return value;
}
@@ -840,7 +866,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x2000L;
+ var flag = 0x4000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -858,7 +884,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._Baggage;
- if ((_bits & 0x4000L) != 0)
+ if ((_bits & 0x8000L) != 0)
{
return value;
}
@@ -868,7 +894,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x4000L;
+ var flag = 0x8000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -886,7 +912,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._CacheControl;
- if ((_bits & 0x8000L) != 0)
+ if ((_bits & 0x10000L) != 0)
{
return value;
}
@@ -896,7 +922,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x8000L;
+ var flag = 0x10000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -914,7 +940,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._ContentType;
- if ((_bits & 0x10000L) != 0)
+ if ((_bits & 0x20000L) != 0)
{
return value;
}
@@ -924,7 +950,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x10000L;
+ var flag = 0x20000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -942,7 +968,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._Cookie;
- if ((_bits & 0x20000L) != 0)
+ if ((_bits & 0x40000L) != 0)
{
return value;
}
@@ -952,7 +978,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x20000L;
+ var flag = 0x40000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -970,7 +996,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._CorrelationContext;
- if ((_bits & 0x40000L) != 0)
+ if ((_bits & 0x80000L) != 0)
{
return value;
}
@@ -980,7 +1006,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x40000L;
+ var flag = 0x80000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -998,7 +1024,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._Date;
- if ((_bits & 0x80000L) != 0)
+ if ((_bits & 0x100000L) != 0)
{
return value;
}
@@ -1008,7 +1034,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x80000L;
+ var flag = 0x100000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1026,7 +1052,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._Expect;
- if ((_bits & 0x100000L) != 0)
+ if ((_bits & 0x200000L) != 0)
{
return value;
}
@@ -1036,7 +1062,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x100000L;
+ var flag = 0x200000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1054,7 +1080,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._From;
- if ((_bits & 0x200000L) != 0)
+ if ((_bits & 0x400000L) != 0)
{
return value;
}
@@ -1064,7 +1090,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x200000L;
+ var flag = 0x400000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1082,7 +1108,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._GrpcAcceptEncoding;
- if ((_bits & 0x400000L) != 0)
+ if ((_bits & 0x800000L) != 0)
{
return value;
}
@@ -1092,7 +1118,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x400000L;
+ var flag = 0x800000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1110,7 +1136,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._GrpcEncoding;
- if ((_bits & 0x800000L) != 0)
+ if ((_bits & 0x1000000L) != 0)
{
return value;
}
@@ -1120,7 +1146,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x800000L;
+ var flag = 0x1000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1138,7 +1164,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._GrpcTimeout;
- if ((_bits & 0x1000000L) != 0)
+ if ((_bits & 0x2000000L) != 0)
{
return value;
}
@@ -1148,7 +1174,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x1000000L;
+ var flag = 0x2000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1166,7 +1192,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._IfMatch;
- if ((_bits & 0x2000000L) != 0)
+ if ((_bits & 0x4000000L) != 0)
{
return value;
}
@@ -1176,7 +1202,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x2000000L;
+ var flag = 0x4000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1194,7 +1220,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._IfModifiedSince;
- if ((_bits & 0x4000000L) != 0)
+ if ((_bits & 0x8000000L) != 0)
{
return value;
}
@@ -1204,7 +1230,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x4000000L;
+ var flag = 0x8000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1222,7 +1248,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._IfNoneMatch;
- if ((_bits & 0x8000000L) != 0)
+ if ((_bits & 0x10000000L) != 0)
{
return value;
}
@@ -1232,7 +1258,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x8000000L;
+ var flag = 0x10000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1250,7 +1276,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._IfRange;
- if ((_bits & 0x10000000L) != 0)
+ if ((_bits & 0x20000000L) != 0)
{
return value;
}
@@ -1260,7 +1286,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x10000000L;
+ var flag = 0x20000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1278,7 +1304,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._IfUnmodifiedSince;
- if ((_bits & 0x20000000L) != 0)
+ if ((_bits & 0x40000000L) != 0)
{
return value;
}
@@ -1288,7 +1314,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x20000000L;
+ var flag = 0x40000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1306,7 +1332,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._KeepAlive;
- if ((_bits & 0x40000000L) != 0)
+ if ((_bits & 0x80000000L) != 0)
{
return value;
}
@@ -1316,7 +1342,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x40000000L;
+ var flag = 0x80000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1334,7 +1360,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._MaxForwards;
- if ((_bits & 0x80000000L) != 0)
+ if ((_bits & 0x100000000L) != 0)
{
return value;
}
@@ -1344,7 +1370,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x80000000L;
+ var flag = 0x100000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1362,7 +1388,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._Origin;
- if ((_bits & 0x100000000L) != 0)
+ if ((_bits & 0x200000000L) != 0)
{
return value;
}
@@ -1372,7 +1398,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x100000000L;
+ var flag = 0x200000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1390,7 +1416,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._Pragma;
- if ((_bits & 0x200000000L) != 0)
+ if ((_bits & 0x400000000L) != 0)
{
return value;
}
@@ -1400,7 +1426,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x200000000L;
+ var flag = 0x400000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1418,7 +1444,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._ProxyAuthorization;
- if ((_bits & 0x400000000L) != 0)
+ if ((_bits & 0x800000000L) != 0)
{
return value;
}
@@ -1428,7 +1454,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x400000000L;
+ var flag = 0x800000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1446,7 +1472,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._Range;
- if ((_bits & 0x800000000L) != 0)
+ if ((_bits & 0x1000000000L) != 0)
{
return value;
}
@@ -1456,7 +1482,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x800000000L;
+ var flag = 0x1000000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1474,7 +1500,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._Referer;
- if ((_bits & 0x1000000000L) != 0)
+ if ((_bits & 0x2000000000L) != 0)
{
return value;
}
@@ -1484,7 +1510,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x1000000000L;
+ var flag = 0x2000000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1502,7 +1528,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._RequestId;
- if ((_bits & 0x2000000000L) != 0)
+ if ((_bits & 0x4000000000L) != 0)
{
return value;
}
@@ -1512,7 +1538,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x2000000000L;
+ var flag = 0x4000000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1530,7 +1556,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._TE;
- if ((_bits & 0x4000000000L) != 0)
+ if ((_bits & 0x8000000000L) != 0)
{
return value;
}
@@ -1540,7 +1566,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x4000000000L;
+ var flag = 0x8000000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1558,7 +1584,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._TraceParent;
- if ((_bits & 0x8000000000L) != 0)
+ if ((_bits & 0x10000000000L) != 0)
{
return value;
}
@@ -1568,7 +1594,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x8000000000L;
+ var flag = 0x10000000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1586,7 +1612,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._TraceState;
- if ((_bits & 0x10000000000L) != 0)
+ if ((_bits & 0x20000000000L) != 0)
{
return value;
}
@@ -1596,7 +1622,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x10000000000L;
+ var flag = 0x20000000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1614,7 +1640,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._TransferEncoding;
- if ((_bits & 0x20000000000L) != 0)
+ if ((_bits & 0x40000000000L) != 0)
{
return value;
}
@@ -1624,7 +1650,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x20000000000L;
+ var flag = 0x40000000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1642,7 +1668,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._Translate;
- if ((_bits & 0x40000000000L) != 0)
+ if ((_bits & 0x80000000000L) != 0)
{
return value;
}
@@ -1652,7 +1678,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x40000000000L;
+ var flag = 0x80000000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1670,7 +1696,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._Upgrade;
- if ((_bits & 0x80000000000L) != 0)
+ if ((_bits & 0x100000000000L) != 0)
{
return value;
}
@@ -1680,7 +1706,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x80000000000L;
+ var flag = 0x100000000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1698,7 +1724,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._UpgradeInsecureRequests;
- if ((_bits & 0x100000000000L) != 0)
+ if ((_bits & 0x200000000000L) != 0)
{
return value;
}
@@ -1708,7 +1734,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x100000000000L;
+ var flag = 0x200000000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1726,7 +1752,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._Via;
- if ((_bits & 0x200000000000L) != 0)
+ if ((_bits & 0x400000000000L) != 0)
{
return value;
}
@@ -1736,7 +1762,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x200000000000L;
+ var flag = 0x400000000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -1754,7 +1780,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
get
{
var value = _headers._Warning;
- if ((_bits & 0x400000000000L) != 0)
+ if ((_bits & 0x800000000000L) != 0)
{
return value;
}
@@ -1764,7 +1790,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (_isReadOnly) { ThrowHeadersReadOnlyException(); }
- var flag = 0x400000000000L;
+ var flag = 0x800000000000L;
if (value.Count > 0)
{
_bits |= flag;
@@ -2575,7 +2601,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.TE, key))
{
- if ((_bits & 0x4000000000L) != 0)
+ if ((_bits & 0x8000000000L) != 0)
{
value = _headers._TE;
return true;
@@ -2585,7 +2611,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.TE.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x4000000000L) != 0)
+ if ((_bits & 0x8000000000L) != 0)
{
value = _headers._TE;
return true;
@@ -2598,7 +2624,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.Via, key))
{
- if ((_bits & 0x200000000000L) != 0)
+ if ((_bits & 0x400000000000L) != 0)
{
value = _headers._Via;
return true;
@@ -2608,7 +2634,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.Via.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x200000000000L) != 0)
+ if ((_bits & 0x400000000000L) != 0)
{
value = _headers._Via;
return true;
@@ -2630,7 +2656,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Date, key))
{
- if ((_bits & 0x80000L) != 0)
+ if ((_bits & 0x100000L) != 0)
{
value = _headers._Date;
return true;
@@ -2639,7 +2665,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.From, key))
{
- if ((_bits & 0x200000L) != 0)
+ if ((_bits & 0x400000L) != 0)
{
value = _headers._From;
return true;
@@ -2658,7 +2684,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Date.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x80000L) != 0)
+ if ((_bits & 0x100000L) != 0)
{
value = _headers._Date;
return true;
@@ -2667,7 +2693,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.From.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x200000L) != 0)
+ if ((_bits & 0x400000L) != 0)
{
value = _headers._From;
return true;
@@ -2689,7 +2715,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Range, key))
{
- if ((_bits & 0x800000000L) != 0)
+ if ((_bits & 0x1000000000L) != 0)
{
value = _headers._Range;
return true;
@@ -2708,7 +2734,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Range.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x800000000L) != 0)
+ if ((_bits & 0x1000000000L) != 0)
{
value = _headers._Range;
return true;
@@ -2730,7 +2756,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Cookie, key))
{
- if ((_bits & 0x20000L) != 0)
+ if ((_bits & 0x40000L) != 0)
{
value = _headers._Cookie;
return true;
@@ -2739,7 +2765,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Expect, key))
{
- if ((_bits & 0x100000L) != 0)
+ if ((_bits & 0x200000L) != 0)
{
value = _headers._Expect;
return true;
@@ -2748,7 +2774,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Origin, key))
{
- if ((_bits & 0x100000000L) != 0)
+ if ((_bits & 0x200000000L) != 0)
{
value = _headers._Origin;
return true;
@@ -2757,7 +2783,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Pragma, key))
{
- if ((_bits & 0x200000000L) != 0)
+ if ((_bits & 0x400000000L) != 0)
{
value = _headers._Pragma;
return true;
@@ -2776,7 +2802,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Cookie.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x20000L) != 0)
+ if ((_bits & 0x40000L) != 0)
{
value = _headers._Cookie;
return true;
@@ -2785,7 +2811,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Expect.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x100000L) != 0)
+ if ((_bits & 0x200000L) != 0)
{
value = _headers._Expect;
return true;
@@ -2794,7 +2820,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Origin.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x100000000L) != 0)
+ if ((_bits & 0x200000000L) != 0)
{
value = _headers._Origin;
return true;
@@ -2803,7 +2829,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Pragma.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x200000000L) != 0)
+ if ((_bits & 0x400000000L) != 0)
{
value = _headers._Pragma;
return true;
@@ -2825,7 +2851,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Scheme, key))
{
- if ((_bits & 0x80L) != 0)
+ if ((_bits & 0x100L) != 0)
{
value = _headers._Scheme;
return true;
@@ -2834,7 +2860,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Baggage, key))
{
- if ((_bits & 0x4000L) != 0)
+ if ((_bits & 0x8000L) != 0)
{
value = _headers._Baggage;
return true;
@@ -2843,7 +2869,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Referer, key))
{
- if ((_bits & 0x1000000000L) != 0)
+ if ((_bits & 0x2000000000L) != 0)
{
value = _headers._Referer;
return true;
@@ -2852,7 +2878,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Upgrade, key))
{
- if ((_bits & 0x80000000000L) != 0)
+ if ((_bits & 0x100000000000L) != 0)
{
value = _headers._Upgrade;
return true;
@@ -2861,7 +2887,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Warning, key))
{
- if ((_bits & 0x400000000000L) != 0)
+ if ((_bits & 0x800000000000L) != 0)
{
value = _headers._Warning;
return true;
@@ -2880,7 +2906,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Scheme.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x80L) != 0)
+ if ((_bits & 0x100L) != 0)
{
value = _headers._Scheme;
return true;
@@ -2889,7 +2915,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Baggage.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x4000L) != 0)
+ if ((_bits & 0x8000L) != 0)
{
value = _headers._Baggage;
return true;
@@ -2898,7 +2924,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Referer.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x1000000000L) != 0)
+ if ((_bits & 0x2000000000L) != 0)
{
value = _headers._Referer;
return true;
@@ -2907,7 +2933,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Upgrade.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x80000000000L) != 0)
+ if ((_bits & 0x100000000000L) != 0)
{
value = _headers._Upgrade;
return true;
@@ -2916,7 +2942,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Warning.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x400000000000L) != 0)
+ if ((_bits & 0x800000000000L) != 0)
{
value = _headers._Warning;
return true;
@@ -2929,7 +2955,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.IfMatch, key))
{
- if ((_bits & 0x2000000L) != 0)
+ if ((_bits & 0x4000000L) != 0)
{
value = _headers._IfMatch;
return true;
@@ -2938,7 +2964,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.IfRange, key))
{
- if ((_bits & 0x10000000L) != 0)
+ if ((_bits & 0x20000000L) != 0)
{
value = _headers._IfRange;
return true;
@@ -2948,7 +2974,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.IfMatch.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x2000000L) != 0)
+ if ((_bits & 0x4000000L) != 0)
{
value = _headers._IfMatch;
return true;
@@ -2957,7 +2983,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.IfRange.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x10000000L) != 0)
+ if ((_bits & 0x20000000L) != 0)
{
value = _headers._IfRange;
return true;
@@ -2968,9 +2994,18 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
case 9:
{
+ if (ReferenceEquals(HeaderNames.Protocol, key))
+ {
+ if ((_bits & 0x80L) != 0)
+ {
+ value = _headers._Protocol;
+ return true;
+ }
+ return false;
+ }
if (ReferenceEquals(HeaderNames.Translate, key))
{
- if ((_bits & 0x40000000000L) != 0)
+ if ((_bits & 0x80000000000L) != 0)
{
value = _headers._Translate;
return true;
@@ -2978,9 +3013,18 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
return false;
}
+ if (HeaderNames.Protocol.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x80L) != 0)
+ {
+ value = _headers._Protocol;
+ return true;
+ }
+ return false;
+ }
if (HeaderNames.Translate.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x40000000000L) != 0)
+ if ((_bits & 0x80000000000L) != 0)
{
value = _headers._Translate;
return true;
@@ -3020,7 +3064,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.KeepAlive, key))
{
- if ((_bits & 0x40000000L) != 0)
+ if ((_bits & 0x80000000L) != 0)
{
value = _headers._KeepAlive;
return true;
@@ -3029,7 +3073,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.RequestId, key))
{
- if ((_bits & 0x2000000000L) != 0)
+ if ((_bits & 0x4000000000L) != 0)
{
value = _headers._RequestId;
return true;
@@ -3038,7 +3082,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.TraceState, key))
{
- if ((_bits & 0x10000000000L) != 0)
+ if ((_bits & 0x20000000000L) != 0)
{
value = _headers._TraceState;
return true;
@@ -3075,7 +3119,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.KeepAlive.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x40000000L) != 0)
+ if ((_bits & 0x80000000L) != 0)
{
value = _headers._KeepAlive;
return true;
@@ -3084,7 +3128,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.RequestId.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x2000000000L) != 0)
+ if ((_bits & 0x4000000000L) != 0)
{
value = _headers._RequestId;
return true;
@@ -3093,7 +3137,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.TraceState.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x10000000000L) != 0)
+ if ((_bits & 0x20000000000L) != 0)
{
value = _headers._TraceState;
return true;
@@ -3106,7 +3150,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.TraceParent, key))
{
- if ((_bits & 0x8000000000L) != 0)
+ if ((_bits & 0x10000000000L) != 0)
{
value = _headers._TraceParent;
return true;
@@ -3116,7 +3160,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.TraceParent.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x8000000000L) != 0)
+ if ((_bits & 0x10000000000L) != 0)
{
value = _headers._TraceParent;
return true;
@@ -3129,7 +3173,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.ContentType, key))
{
- if ((_bits & 0x10000L) != 0)
+ if ((_bits & 0x20000L) != 0)
{
value = _headers._ContentType;
return true;
@@ -3138,7 +3182,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.GrpcTimeout, key))
{
- if ((_bits & 0x1000000L) != 0)
+ if ((_bits & 0x2000000L) != 0)
{
value = _headers._GrpcTimeout;
return true;
@@ -3147,7 +3191,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.MaxForwards, key))
{
- if ((_bits & 0x80000000L) != 0)
+ if ((_bits & 0x100000000L) != 0)
{
value = _headers._MaxForwards;
return true;
@@ -3157,7 +3201,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.ContentType.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x10000L) != 0)
+ if ((_bits & 0x20000L) != 0)
{
value = _headers._ContentType;
return true;
@@ -3166,7 +3210,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.GrpcTimeout.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x1000000L) != 0)
+ if ((_bits & 0x2000000L) != 0)
{
value = _headers._GrpcTimeout;
return true;
@@ -3175,7 +3219,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.MaxForwards.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x80000000L) != 0)
+ if ((_bits & 0x100000000L) != 0)
{
value = _headers._MaxForwards;
return true;
@@ -3188,7 +3232,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.Authorization, key))
{
- if ((_bits & 0x2000L) != 0)
+ if ((_bits & 0x4000L) != 0)
{
value = _headers._Authorization;
return true;
@@ -3197,7 +3241,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.CacheControl, key))
{
- if ((_bits & 0x8000L) != 0)
+ if ((_bits & 0x10000L) != 0)
{
value = _headers._CacheControl;
return true;
@@ -3206,7 +3250,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.GrpcEncoding, key))
{
- if ((_bits & 0x800000L) != 0)
+ if ((_bits & 0x1000000L) != 0)
{
value = _headers._GrpcEncoding;
return true;
@@ -3215,7 +3259,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.IfNoneMatch, key))
{
- if ((_bits & 0x8000000L) != 0)
+ if ((_bits & 0x10000000L) != 0)
{
value = _headers._IfNoneMatch;
return true;
@@ -3225,7 +3269,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.Authorization.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x2000L) != 0)
+ if ((_bits & 0x4000L) != 0)
{
value = _headers._Authorization;
return true;
@@ -3234,7 +3278,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.CacheControl.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x8000L) != 0)
+ if ((_bits & 0x10000L) != 0)
{
value = _headers._CacheControl;
return true;
@@ -3243,7 +3287,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.GrpcEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x800000L) != 0)
+ if ((_bits & 0x1000000L) != 0)
{
value = _headers._GrpcEncoding;
return true;
@@ -3252,7 +3296,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.IfNoneMatch.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x8000000L) != 0)
+ if ((_bits & 0x10000000L) != 0)
{
value = _headers._IfNoneMatch;
return true;
@@ -3265,7 +3309,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.AcceptCharset, key))
{
- if ((_bits & 0x100L) != 0)
+ if ((_bits & 0x200L) != 0)
{
value = _headers._AcceptCharset;
return true;
@@ -3284,7 +3328,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.AcceptCharset.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x100L) != 0)
+ if ((_bits & 0x200L) != 0)
{
value = _headers._AcceptCharset;
return true;
@@ -3306,7 +3350,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.AcceptEncoding, key))
{
- if ((_bits & 0x200L) != 0)
+ if ((_bits & 0x400L) != 0)
{
value = _headers._AcceptEncoding;
return true;
@@ -3315,7 +3359,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.AcceptLanguage, key))
{
- if ((_bits & 0x400L) != 0)
+ if ((_bits & 0x800L) != 0)
{
value = _headers._AcceptLanguage;
return true;
@@ -3325,7 +3369,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.AcceptEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x200L) != 0)
+ if ((_bits & 0x400L) != 0)
{
value = _headers._AcceptEncoding;
return true;
@@ -3334,7 +3378,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.AcceptLanguage.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x400L) != 0)
+ if ((_bits & 0x800L) != 0)
{
value = _headers._AcceptLanguage;
return true;
@@ -3347,7 +3391,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.IfModifiedSince, key))
{
- if ((_bits & 0x4000000L) != 0)
+ if ((_bits & 0x8000000L) != 0)
{
value = _headers._IfModifiedSince;
return true;
@@ -3356,7 +3400,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.TransferEncoding, key))
{
- if ((_bits & 0x20000000000L) != 0)
+ if ((_bits & 0x40000000000L) != 0)
{
value = _headers._TransferEncoding;
return true;
@@ -3366,7 +3410,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.IfModifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x4000000L) != 0)
+ if ((_bits & 0x8000000L) != 0)
{
value = _headers._IfModifiedSince;
return true;
@@ -3375,7 +3419,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.TransferEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x20000000000L) != 0)
+ if ((_bits & 0x40000000000L) != 0)
{
value = _headers._TransferEncoding;
return true;
@@ -3388,7 +3432,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.CorrelationContext, key))
{
- if ((_bits & 0x40000L) != 0)
+ if ((_bits & 0x80000L) != 0)
{
value = _headers._CorrelationContext;
return true;
@@ -3397,7 +3441,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.IfUnmodifiedSince, key))
{
- if ((_bits & 0x20000000L) != 0)
+ if ((_bits & 0x40000000L) != 0)
{
value = _headers._IfUnmodifiedSince;
return true;
@@ -3406,7 +3450,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.ProxyAuthorization, key))
{
- if ((_bits & 0x400000000L) != 0)
+ if ((_bits & 0x800000000L) != 0)
{
value = _headers._ProxyAuthorization;
return true;
@@ -3416,7 +3460,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.CorrelationContext.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x40000L) != 0)
+ if ((_bits & 0x80000L) != 0)
{
value = _headers._CorrelationContext;
return true;
@@ -3425,7 +3469,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.IfUnmodifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x20000000L) != 0)
+ if ((_bits & 0x40000000L) != 0)
{
value = _headers._IfUnmodifiedSince;
return true;
@@ -3434,7 +3478,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.ProxyAuthorization.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x400000000L) != 0)
+ if ((_bits & 0x800000000L) != 0)
{
value = _headers._ProxyAuthorization;
return true;
@@ -3447,7 +3491,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.GrpcAcceptEncoding, key))
{
- if ((_bits & 0x400000L) != 0)
+ if ((_bits & 0x800000L) != 0)
{
value = _headers._GrpcAcceptEncoding;
return true;
@@ -3457,7 +3501,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.GrpcAcceptEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x400000L) != 0)
+ if ((_bits & 0x800000L) != 0)
{
value = _headers._GrpcAcceptEncoding;
return true;
@@ -3470,7 +3514,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.UpgradeInsecureRequests, key))
{
- if ((_bits & 0x100000000000L) != 0)
+ if ((_bits & 0x200000000000L) != 0)
{
value = _headers._UpgradeInsecureRequests;
return true;
@@ -3480,7 +3524,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.UpgradeInsecureRequests.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x100000000000L) != 0)
+ if ((_bits & 0x200000000000L) != 0)
{
value = _headers._UpgradeInsecureRequests;
return true;
@@ -3493,7 +3537,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.AccessControlRequestMethod, key))
{
- if ((_bits & 0x1000L) != 0)
+ if ((_bits & 0x2000L) != 0)
{
value = _headers._AccessControlRequestMethod;
return true;
@@ -3503,7 +3547,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.AccessControlRequestMethod.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x1000L) != 0)
+ if ((_bits & 0x2000L) != 0)
{
value = _headers._AccessControlRequestMethod;
return true;
@@ -3516,7 +3560,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.AccessControlRequestHeaders, key))
{
- if ((_bits & 0x800L) != 0)
+ if ((_bits & 0x1000L) != 0)
{
value = _headers._AccessControlRequestHeaders;
return true;
@@ -3526,7 +3570,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.AccessControlRequestHeaders.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x800L) != 0)
+ if ((_bits & 0x1000L) != 0)
{
value = _headers._AccessControlRequestHeaders;
return true;
@@ -3548,14 +3592,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.TE, key))
{
- _bits |= 0x4000000000L;
+ _bits |= 0x8000000000L;
_headers._TE = value;
return;
}
if (HeaderNames.TE.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x4000000000L;
+ _bits |= 0x8000000000L;
_headers._TE = value;
return;
}
@@ -3565,14 +3609,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.Via, key))
{
- _bits |= 0x200000000000L;
+ _bits |= 0x400000000000L;
_headers._Via = value;
return;
}
if (HeaderNames.Via.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x200000000000L;
+ _bits |= 0x400000000000L;
_headers._Via = value;
return;
}
@@ -3588,13 +3632,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Date, key))
{
- _bits |= 0x80000L;
+ _bits |= 0x100000L;
_headers._Date = value;
return;
}
if (ReferenceEquals(HeaderNames.From, key))
{
- _bits |= 0x200000L;
+ _bits |= 0x400000L;
_headers._From = value;
return;
}
@@ -3607,13 +3651,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Date.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x80000L;
+ _bits |= 0x100000L;
_headers._Date = value;
return;
}
if (HeaderNames.From.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x200000L;
+ _bits |= 0x400000L;
_headers._From = value;
return;
}
@@ -3629,7 +3673,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Range, key))
{
- _bits |= 0x800000000L;
+ _bits |= 0x1000000000L;
_headers._Range = value;
return;
}
@@ -3642,7 +3686,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Range.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x800000000L;
+ _bits |= 0x1000000000L;
_headers._Range = value;
return;
}
@@ -3658,25 +3702,25 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Cookie, key))
{
- _bits |= 0x20000L;
+ _bits |= 0x40000L;
_headers._Cookie = value;
return;
}
if (ReferenceEquals(HeaderNames.Expect, key))
{
- _bits |= 0x100000L;
+ _bits |= 0x200000L;
_headers._Expect = value;
return;
}
if (ReferenceEquals(HeaderNames.Origin, key))
{
- _bits |= 0x100000000L;
+ _bits |= 0x200000000L;
_headers._Origin = value;
return;
}
if (ReferenceEquals(HeaderNames.Pragma, key))
{
- _bits |= 0x200000000L;
+ _bits |= 0x400000000L;
_headers._Pragma = value;
return;
}
@@ -3689,25 +3733,25 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Cookie.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x20000L;
+ _bits |= 0x40000L;
_headers._Cookie = value;
return;
}
if (HeaderNames.Expect.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x100000L;
+ _bits |= 0x200000L;
_headers._Expect = value;
return;
}
if (HeaderNames.Origin.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x100000000L;
+ _bits |= 0x200000000L;
_headers._Origin = value;
return;
}
if (HeaderNames.Pragma.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x200000000L;
+ _bits |= 0x400000000L;
_headers._Pragma = value;
return;
}
@@ -3723,31 +3767,31 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Scheme, key))
{
- _bits |= 0x80L;
+ _bits |= 0x100L;
_headers._Scheme = value;
return;
}
if (ReferenceEquals(HeaderNames.Baggage, key))
{
- _bits |= 0x4000L;
+ _bits |= 0x8000L;
_headers._Baggage = value;
return;
}
if (ReferenceEquals(HeaderNames.Referer, key))
{
- _bits |= 0x1000000000L;
+ _bits |= 0x2000000000L;
_headers._Referer = value;
return;
}
if (ReferenceEquals(HeaderNames.Upgrade, key))
{
- _bits |= 0x80000000000L;
+ _bits |= 0x100000000000L;
_headers._Upgrade = value;
return;
}
if (ReferenceEquals(HeaderNames.Warning, key))
{
- _bits |= 0x400000000000L;
+ _bits |= 0x800000000000L;
_headers._Warning = value;
return;
}
@@ -3760,31 +3804,31 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Scheme.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x80L;
+ _bits |= 0x100L;
_headers._Scheme = value;
return;
}
if (HeaderNames.Baggage.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x4000L;
+ _bits |= 0x8000L;
_headers._Baggage = value;
return;
}
if (HeaderNames.Referer.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x1000000000L;
+ _bits |= 0x2000000000L;
_headers._Referer = value;
return;
}
if (HeaderNames.Upgrade.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x80000000000L;
+ _bits |= 0x100000000000L;
_headers._Upgrade = value;
return;
}
if (HeaderNames.Warning.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x400000000000L;
+ _bits |= 0x800000000000L;
_headers._Warning = value;
return;
}
@@ -3794,26 +3838,26 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.IfMatch, key))
{
- _bits |= 0x2000000L;
+ _bits |= 0x4000000L;
_headers._IfMatch = value;
return;
}
if (ReferenceEquals(HeaderNames.IfRange, key))
{
- _bits |= 0x10000000L;
+ _bits |= 0x20000000L;
_headers._IfRange = value;
return;
}
if (HeaderNames.IfMatch.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x2000000L;
+ _bits |= 0x4000000L;
_headers._IfMatch = value;
return;
}
if (HeaderNames.IfRange.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x10000000L;
+ _bits |= 0x20000000L;
_headers._IfRange = value;
return;
}
@@ -3821,16 +3865,28 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
case 9:
{
+ if (ReferenceEquals(HeaderNames.Protocol, key))
+ {
+ _bits |= 0x80L;
+ _headers._Protocol = value;
+ return;
+ }
if (ReferenceEquals(HeaderNames.Translate, key))
{
- _bits |= 0x40000000000L;
+ _bits |= 0x80000000000L;
_headers._Translate = value;
return;
}
+ if (HeaderNames.Protocol.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ _bits |= 0x80L;
+ _headers._Protocol = value;
+ return;
+ }
if (HeaderNames.Translate.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x40000000000L;
+ _bits |= 0x80000000000L;
_headers._Translate = value;
return;
}
@@ -3858,19 +3914,19 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.KeepAlive, key))
{
- _bits |= 0x40000000L;
+ _bits |= 0x80000000L;
_headers._KeepAlive = value;
return;
}
if (ReferenceEquals(HeaderNames.RequestId, key))
{
- _bits |= 0x2000000000L;
+ _bits |= 0x4000000000L;
_headers._RequestId = value;
return;
}
if (ReferenceEquals(HeaderNames.TraceState, key))
{
- _bits |= 0x10000000000L;
+ _bits |= 0x20000000000L;
_headers._TraceState = value;
return;
}
@@ -3895,19 +3951,19 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.KeepAlive.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x40000000L;
+ _bits |= 0x80000000L;
_headers._KeepAlive = value;
return;
}
if (HeaderNames.RequestId.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x2000000000L;
+ _bits |= 0x4000000000L;
_headers._RequestId = value;
return;
}
if (HeaderNames.TraceState.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x10000000000L;
+ _bits |= 0x20000000000L;
_headers._TraceState = value;
return;
}
@@ -3917,14 +3973,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.TraceParent, key))
{
- _bits |= 0x8000000000L;
+ _bits |= 0x10000000000L;
_headers._TraceParent = value;
return;
}
if (HeaderNames.TraceParent.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x8000000000L;
+ _bits |= 0x10000000000L;
_headers._TraceParent = value;
return;
}
@@ -3934,38 +3990,38 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.ContentType, key))
{
- _bits |= 0x10000L;
+ _bits |= 0x20000L;
_headers._ContentType = value;
return;
}
if (ReferenceEquals(HeaderNames.GrpcTimeout, key))
{
- _bits |= 0x1000000L;
+ _bits |= 0x2000000L;
_headers._GrpcTimeout = value;
return;
}
if (ReferenceEquals(HeaderNames.MaxForwards, key))
{
- _bits |= 0x80000000L;
+ _bits |= 0x100000000L;
_headers._MaxForwards = value;
return;
}
if (HeaderNames.ContentType.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x10000L;
+ _bits |= 0x20000L;
_headers._ContentType = value;
return;
}
if (HeaderNames.GrpcTimeout.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x1000000L;
+ _bits |= 0x2000000L;
_headers._GrpcTimeout = value;
return;
}
if (HeaderNames.MaxForwards.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x80000000L;
+ _bits |= 0x100000000L;
_headers._MaxForwards = value;
return;
}
@@ -3975,50 +4031,50 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.Authorization, key))
{
- _bits |= 0x2000L;
+ _bits |= 0x4000L;
_headers._Authorization = value;
return;
}
if (ReferenceEquals(HeaderNames.CacheControl, key))
{
- _bits |= 0x8000L;
+ _bits |= 0x10000L;
_headers._CacheControl = value;
return;
}
if (ReferenceEquals(HeaderNames.GrpcEncoding, key))
{
- _bits |= 0x800000L;
+ _bits |= 0x1000000L;
_headers._GrpcEncoding = value;
return;
}
if (ReferenceEquals(HeaderNames.IfNoneMatch, key))
{
- _bits |= 0x8000000L;
+ _bits |= 0x10000000L;
_headers._IfNoneMatch = value;
return;
}
if (HeaderNames.Authorization.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x2000L;
+ _bits |= 0x4000L;
_headers._Authorization = value;
return;
}
if (HeaderNames.CacheControl.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x8000L;
+ _bits |= 0x10000L;
_headers._CacheControl = value;
return;
}
if (HeaderNames.GrpcEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x800000L;
+ _bits |= 0x1000000L;
_headers._GrpcEncoding = value;
return;
}
if (HeaderNames.IfNoneMatch.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x8000000L;
+ _bits |= 0x10000000L;
_headers._IfNoneMatch = value;
return;
}
@@ -4028,7 +4084,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.AcceptCharset, key))
{
- _bits |= 0x100L;
+ _bits |= 0x200L;
_headers._AcceptCharset = value;
return;
}
@@ -4040,7 +4096,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.AcceptCharset.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x100L;
+ _bits |= 0x200L;
_headers._AcceptCharset = value;
return;
}
@@ -4055,26 +4111,26 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.AcceptEncoding, key))
{
- _bits |= 0x200L;
+ _bits |= 0x400L;
_headers._AcceptEncoding = value;
return;
}
if (ReferenceEquals(HeaderNames.AcceptLanguage, key))
{
- _bits |= 0x400L;
+ _bits |= 0x800L;
_headers._AcceptLanguage = value;
return;
}
if (HeaderNames.AcceptEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x200L;
+ _bits |= 0x400L;
_headers._AcceptEncoding = value;
return;
}
if (HeaderNames.AcceptLanguage.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x400L;
+ _bits |= 0x800L;
_headers._AcceptLanguage = value;
return;
}
@@ -4084,26 +4140,26 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.IfModifiedSince, key))
{
- _bits |= 0x4000000L;
+ _bits |= 0x8000000L;
_headers._IfModifiedSince = value;
return;
}
if (ReferenceEquals(HeaderNames.TransferEncoding, key))
{
- _bits |= 0x20000000000L;
+ _bits |= 0x40000000000L;
_headers._TransferEncoding = value;
return;
}
if (HeaderNames.IfModifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x4000000L;
+ _bits |= 0x8000000L;
_headers._IfModifiedSince = value;
return;
}
if (HeaderNames.TransferEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x20000000000L;
+ _bits |= 0x40000000000L;
_headers._TransferEncoding = value;
return;
}
@@ -4113,38 +4169,38 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.CorrelationContext, key))
{
- _bits |= 0x40000L;
+ _bits |= 0x80000L;
_headers._CorrelationContext = value;
return;
}
if (ReferenceEquals(HeaderNames.IfUnmodifiedSince, key))
{
- _bits |= 0x20000000L;
+ _bits |= 0x40000000L;
_headers._IfUnmodifiedSince = value;
return;
}
if (ReferenceEquals(HeaderNames.ProxyAuthorization, key))
{
- _bits |= 0x400000000L;
+ _bits |= 0x800000000L;
_headers._ProxyAuthorization = value;
return;
}
if (HeaderNames.CorrelationContext.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x40000L;
+ _bits |= 0x80000L;
_headers._CorrelationContext = value;
return;
}
if (HeaderNames.IfUnmodifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x20000000L;
+ _bits |= 0x40000000L;
_headers._IfUnmodifiedSince = value;
return;
}
if (HeaderNames.ProxyAuthorization.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x400000000L;
+ _bits |= 0x800000000L;
_headers._ProxyAuthorization = value;
return;
}
@@ -4154,14 +4210,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.GrpcAcceptEncoding, key))
{
- _bits |= 0x400000L;
+ _bits |= 0x800000L;
_headers._GrpcAcceptEncoding = value;
return;
}
if (HeaderNames.GrpcAcceptEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x400000L;
+ _bits |= 0x800000L;
_headers._GrpcAcceptEncoding = value;
return;
}
@@ -4171,14 +4227,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.UpgradeInsecureRequests, key))
{
- _bits |= 0x100000000000L;
+ _bits |= 0x200000000000L;
_headers._UpgradeInsecureRequests = value;
return;
}
if (HeaderNames.UpgradeInsecureRequests.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x100000000000L;
+ _bits |= 0x200000000000L;
_headers._UpgradeInsecureRequests = value;
return;
}
@@ -4188,14 +4244,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.AccessControlRequestMethod, key))
{
- _bits |= 0x1000L;
+ _bits |= 0x2000L;
_headers._AccessControlRequestMethod = value;
return;
}
if (HeaderNames.AccessControlRequestMethod.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x1000L;
+ _bits |= 0x2000L;
_headers._AccessControlRequestMethod = value;
return;
}
@@ -4205,14 +4261,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.AccessControlRequestHeaders, key))
{
- _bits |= 0x800L;
+ _bits |= 0x1000L;
_headers._AccessControlRequestHeaders = value;
return;
}
if (HeaderNames.AccessControlRequestHeaders.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- _bits |= 0x800L;
+ _bits |= 0x1000L;
_headers._AccessControlRequestHeaders = value;
return;
}
@@ -4231,9 +4287,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.TE, key))
{
- if ((_bits & 0x4000000000L) == 0)
+ if ((_bits & 0x8000000000L) == 0)
{
- _bits |= 0x4000000000L;
+ _bits |= 0x8000000000L;
_headers._TE = value;
return true;
}
@@ -4242,9 +4298,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.TE.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x4000000000L) == 0)
+ if ((_bits & 0x8000000000L) == 0)
{
- _bits |= 0x4000000000L;
+ _bits |= 0x8000000000L;
_headers._TE = value;
return true;
}
@@ -4256,9 +4312,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.Via, key))
{
- if ((_bits & 0x200000000000L) == 0)
+ if ((_bits & 0x400000000000L) == 0)
{
- _bits |= 0x200000000000L;
+ _bits |= 0x400000000000L;
_headers._Via = value;
return true;
}
@@ -4267,9 +4323,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.Via.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x200000000000L) == 0)
+ if ((_bits & 0x400000000000L) == 0)
{
- _bits |= 0x200000000000L;
+ _bits |= 0x400000000000L;
_headers._Via = value;
return true;
}
@@ -4291,9 +4347,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Date, key))
{
- if ((_bits & 0x80000L) == 0)
+ if ((_bits & 0x100000L) == 0)
{
- _bits |= 0x80000L;
+ _bits |= 0x100000L;
_headers._Date = value;
return true;
}
@@ -4301,9 +4357,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.From, key))
{
- if ((_bits & 0x200000L) == 0)
+ if ((_bits & 0x400000L) == 0)
{
- _bits |= 0x200000L;
+ _bits |= 0x400000L;
_headers._From = value;
return true;
}
@@ -4322,9 +4378,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Date.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x80000L) == 0)
+ if ((_bits & 0x100000L) == 0)
{
- _bits |= 0x80000L;
+ _bits |= 0x100000L;
_headers._Date = value;
return true;
}
@@ -4332,9 +4388,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.From.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x200000L) == 0)
+ if ((_bits & 0x400000L) == 0)
{
- _bits |= 0x200000L;
+ _bits |= 0x400000L;
_headers._From = value;
return true;
}
@@ -4356,9 +4412,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Range, key))
{
- if ((_bits & 0x800000000L) == 0)
+ if ((_bits & 0x1000000000L) == 0)
{
- _bits |= 0x800000000L;
+ _bits |= 0x1000000000L;
_headers._Range = value;
return true;
}
@@ -4377,9 +4433,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Range.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x800000000L) == 0)
+ if ((_bits & 0x1000000000L) == 0)
{
- _bits |= 0x800000000L;
+ _bits |= 0x1000000000L;
_headers._Range = value;
return true;
}
@@ -4401,9 +4457,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Cookie, key))
{
- if ((_bits & 0x20000L) == 0)
+ if ((_bits & 0x40000L) == 0)
{
- _bits |= 0x20000L;
+ _bits |= 0x40000L;
_headers._Cookie = value;
return true;
}
@@ -4411,9 +4467,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Expect, key))
{
- if ((_bits & 0x100000L) == 0)
+ if ((_bits & 0x200000L) == 0)
{
- _bits |= 0x100000L;
+ _bits |= 0x200000L;
_headers._Expect = value;
return true;
}
@@ -4421,9 +4477,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Origin, key))
{
- if ((_bits & 0x100000000L) == 0)
+ if ((_bits & 0x200000000L) == 0)
{
- _bits |= 0x100000000L;
+ _bits |= 0x200000000L;
_headers._Origin = value;
return true;
}
@@ -4431,9 +4487,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Pragma, key))
{
- if ((_bits & 0x200000000L) == 0)
+ if ((_bits & 0x400000000L) == 0)
{
- _bits |= 0x200000000L;
+ _bits |= 0x400000000L;
_headers._Pragma = value;
return true;
}
@@ -4452,9 +4508,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Cookie.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x20000L) == 0)
+ if ((_bits & 0x40000L) == 0)
{
- _bits |= 0x20000L;
+ _bits |= 0x40000L;
_headers._Cookie = value;
return true;
}
@@ -4462,9 +4518,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Expect.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x100000L) == 0)
+ if ((_bits & 0x200000L) == 0)
{
- _bits |= 0x100000L;
+ _bits |= 0x200000L;
_headers._Expect = value;
return true;
}
@@ -4472,9 +4528,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Origin.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x100000000L) == 0)
+ if ((_bits & 0x200000000L) == 0)
{
- _bits |= 0x100000000L;
+ _bits |= 0x200000000L;
_headers._Origin = value;
return true;
}
@@ -4482,9 +4538,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Pragma.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x200000000L) == 0)
+ if ((_bits & 0x400000000L) == 0)
{
- _bits |= 0x200000000L;
+ _bits |= 0x400000000L;
_headers._Pragma = value;
return true;
}
@@ -4506,9 +4562,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Scheme, key))
{
- if ((_bits & 0x80L) == 0)
+ if ((_bits & 0x100L) == 0)
{
- _bits |= 0x80L;
+ _bits |= 0x100L;
_headers._Scheme = value;
return true;
}
@@ -4516,9 +4572,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Baggage, key))
{
- if ((_bits & 0x4000L) == 0)
+ if ((_bits & 0x8000L) == 0)
{
- _bits |= 0x4000L;
+ _bits |= 0x8000L;
_headers._Baggage = value;
return true;
}
@@ -4526,9 +4582,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Referer, key))
{
- if ((_bits & 0x1000000000L) == 0)
+ if ((_bits & 0x2000000000L) == 0)
{
- _bits |= 0x1000000000L;
+ _bits |= 0x2000000000L;
_headers._Referer = value;
return true;
}
@@ -4536,9 +4592,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Upgrade, key))
{
- if ((_bits & 0x80000000000L) == 0)
+ if ((_bits & 0x100000000000L) == 0)
{
- _bits |= 0x80000000000L;
+ _bits |= 0x100000000000L;
_headers._Upgrade = value;
return true;
}
@@ -4546,9 +4602,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Warning, key))
{
- if ((_bits & 0x400000000000L) == 0)
+ if ((_bits & 0x800000000000L) == 0)
{
- _bits |= 0x400000000000L;
+ _bits |= 0x800000000000L;
_headers._Warning = value;
return true;
}
@@ -4567,9 +4623,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Scheme.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x80L) == 0)
+ if ((_bits & 0x100L) == 0)
{
- _bits |= 0x80L;
+ _bits |= 0x100L;
_headers._Scheme = value;
return true;
}
@@ -4577,9 +4633,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Baggage.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x4000L) == 0)
+ if ((_bits & 0x8000L) == 0)
{
- _bits |= 0x4000L;
+ _bits |= 0x8000L;
_headers._Baggage = value;
return true;
}
@@ -4587,9 +4643,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Referer.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x1000000000L) == 0)
+ if ((_bits & 0x2000000000L) == 0)
{
- _bits |= 0x1000000000L;
+ _bits |= 0x2000000000L;
_headers._Referer = value;
return true;
}
@@ -4597,9 +4653,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Upgrade.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x80000000000L) == 0)
+ if ((_bits & 0x100000000000L) == 0)
{
- _bits |= 0x80000000000L;
+ _bits |= 0x100000000000L;
_headers._Upgrade = value;
return true;
}
@@ -4607,9 +4663,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Warning.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x400000000000L) == 0)
+ if ((_bits & 0x800000000000L) == 0)
{
- _bits |= 0x400000000000L;
+ _bits |= 0x800000000000L;
_headers._Warning = value;
return true;
}
@@ -4621,9 +4677,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.IfMatch, key))
{
- if ((_bits & 0x2000000L) == 0)
+ if ((_bits & 0x4000000L) == 0)
{
- _bits |= 0x2000000L;
+ _bits |= 0x4000000L;
_headers._IfMatch = value;
return true;
}
@@ -4631,9 +4687,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.IfRange, key))
{
- if ((_bits & 0x10000000L) == 0)
+ if ((_bits & 0x20000000L) == 0)
{
- _bits |= 0x10000000L;
+ _bits |= 0x20000000L;
_headers._IfRange = value;
return true;
}
@@ -4642,9 +4698,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.IfMatch.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x2000000L) == 0)
+ if ((_bits & 0x4000000L) == 0)
{
- _bits |= 0x2000000L;
+ _bits |= 0x4000000L;
_headers._IfMatch = value;
return true;
}
@@ -4652,9 +4708,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.IfRange.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x10000000L) == 0)
+ if ((_bits & 0x20000000L) == 0)
{
- _bits |= 0x10000000L;
+ _bits |= 0x20000000L;
_headers._IfRange = value;
return true;
}
@@ -4664,22 +4720,42 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
case 9:
{
+ if (ReferenceEquals(HeaderNames.Protocol, key))
+ {
+ if ((_bits & 0x80L) == 0)
+ {
+ _bits |= 0x80L;
+ _headers._Protocol = value;
+ return true;
+ }
+ return false;
+ }
if (ReferenceEquals(HeaderNames.Translate, key))
{
- if ((_bits & 0x40000000000L) == 0)
+ if ((_bits & 0x80000000000L) == 0)
{
- _bits |= 0x40000000000L;
+ _bits |= 0x80000000000L;
_headers._Translate = value;
return true;
}
return false;
}
+ if (HeaderNames.Protocol.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x80L) == 0)
+ {
+ _bits |= 0x80L;
+ _headers._Protocol = value;
+ return true;
+ }
+ return false;
+ }
if (HeaderNames.Translate.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x40000000000L) == 0)
+ if ((_bits & 0x80000000000L) == 0)
{
- _bits |= 0x40000000000L;
+ _bits |= 0x80000000000L;
_headers._Translate = value;
return true;
}
@@ -4721,9 +4797,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.KeepAlive, key))
{
- if ((_bits & 0x40000000L) == 0)
+ if ((_bits & 0x80000000L) == 0)
{
- _bits |= 0x40000000L;
+ _bits |= 0x80000000L;
_headers._KeepAlive = value;
return true;
}
@@ -4731,9 +4807,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.RequestId, key))
{
- if ((_bits & 0x2000000000L) == 0)
+ if ((_bits & 0x4000000000L) == 0)
{
- _bits |= 0x2000000000L;
+ _bits |= 0x4000000000L;
_headers._RequestId = value;
return true;
}
@@ -4741,9 +4817,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.TraceState, key))
{
- if ((_bits & 0x10000000000L) == 0)
+ if ((_bits & 0x20000000000L) == 0)
{
- _bits |= 0x10000000000L;
+ _bits |= 0x20000000000L;
_headers._TraceState = value;
return true;
}
@@ -4782,9 +4858,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.KeepAlive.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x40000000L) == 0)
+ if ((_bits & 0x80000000L) == 0)
{
- _bits |= 0x40000000L;
+ _bits |= 0x80000000L;
_headers._KeepAlive = value;
return true;
}
@@ -4792,9 +4868,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.RequestId.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x2000000000L) == 0)
+ if ((_bits & 0x4000000000L) == 0)
{
- _bits |= 0x2000000000L;
+ _bits |= 0x4000000000L;
_headers._RequestId = value;
return true;
}
@@ -4802,9 +4878,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.TraceState.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x10000000000L) == 0)
+ if ((_bits & 0x20000000000L) == 0)
{
- _bits |= 0x10000000000L;
+ _bits |= 0x20000000000L;
_headers._TraceState = value;
return true;
}
@@ -4816,9 +4892,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.TraceParent, key))
{
- if ((_bits & 0x8000000000L) == 0)
+ if ((_bits & 0x10000000000L) == 0)
{
- _bits |= 0x8000000000L;
+ _bits |= 0x10000000000L;
_headers._TraceParent = value;
return true;
}
@@ -4827,9 +4903,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.TraceParent.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x8000000000L) == 0)
+ if ((_bits & 0x10000000000L) == 0)
{
- _bits |= 0x8000000000L;
+ _bits |= 0x10000000000L;
_headers._TraceParent = value;
return true;
}
@@ -4841,9 +4917,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.ContentType, key))
{
- if ((_bits & 0x10000L) == 0)
+ if ((_bits & 0x20000L) == 0)
{
- _bits |= 0x10000L;
+ _bits |= 0x20000L;
_headers._ContentType = value;
return true;
}
@@ -4851,9 +4927,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.GrpcTimeout, key))
{
- if ((_bits & 0x1000000L) == 0)
+ if ((_bits & 0x2000000L) == 0)
{
- _bits |= 0x1000000L;
+ _bits |= 0x2000000L;
_headers._GrpcTimeout = value;
return true;
}
@@ -4861,9 +4937,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.MaxForwards, key))
{
- if ((_bits & 0x80000000L) == 0)
+ if ((_bits & 0x100000000L) == 0)
{
- _bits |= 0x80000000L;
+ _bits |= 0x100000000L;
_headers._MaxForwards = value;
return true;
}
@@ -4872,9 +4948,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.ContentType.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x10000L) == 0)
+ if ((_bits & 0x20000L) == 0)
{
- _bits |= 0x10000L;
+ _bits |= 0x20000L;
_headers._ContentType = value;
return true;
}
@@ -4882,9 +4958,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.GrpcTimeout.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x1000000L) == 0)
+ if ((_bits & 0x2000000L) == 0)
{
- _bits |= 0x1000000L;
+ _bits |= 0x2000000L;
_headers._GrpcTimeout = value;
return true;
}
@@ -4892,9 +4968,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.MaxForwards.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x80000000L) == 0)
+ if ((_bits & 0x100000000L) == 0)
{
- _bits |= 0x80000000L;
+ _bits |= 0x100000000L;
_headers._MaxForwards = value;
return true;
}
@@ -4906,9 +4982,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.Authorization, key))
{
- if ((_bits & 0x2000L) == 0)
+ if ((_bits & 0x4000L) == 0)
{
- _bits |= 0x2000L;
+ _bits |= 0x4000L;
_headers._Authorization = value;
return true;
}
@@ -4916,9 +4992,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.CacheControl, key))
{
- if ((_bits & 0x8000L) == 0)
+ if ((_bits & 0x10000L) == 0)
{
- _bits |= 0x8000L;
+ _bits |= 0x10000L;
_headers._CacheControl = value;
return true;
}
@@ -4926,9 +5002,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.GrpcEncoding, key))
{
- if ((_bits & 0x800000L) == 0)
+ if ((_bits & 0x1000000L) == 0)
{
- _bits |= 0x800000L;
+ _bits |= 0x1000000L;
_headers._GrpcEncoding = value;
return true;
}
@@ -4936,9 +5012,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.IfNoneMatch, key))
{
- if ((_bits & 0x8000000L) == 0)
+ if ((_bits & 0x10000000L) == 0)
{
- _bits |= 0x8000000L;
+ _bits |= 0x10000000L;
_headers._IfNoneMatch = value;
return true;
}
@@ -4947,9 +5023,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.Authorization.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x2000L) == 0)
+ if ((_bits & 0x4000L) == 0)
{
- _bits |= 0x2000L;
+ _bits |= 0x4000L;
_headers._Authorization = value;
return true;
}
@@ -4957,9 +5033,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.CacheControl.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x8000L) == 0)
+ if ((_bits & 0x10000L) == 0)
{
- _bits |= 0x8000L;
+ _bits |= 0x10000L;
_headers._CacheControl = value;
return true;
}
@@ -4967,9 +5043,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.GrpcEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x800000L) == 0)
+ if ((_bits & 0x1000000L) == 0)
{
- _bits |= 0x800000L;
+ _bits |= 0x1000000L;
_headers._GrpcEncoding = value;
return true;
}
@@ -4977,9 +5053,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.IfNoneMatch.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x8000000L) == 0)
+ if ((_bits & 0x10000000L) == 0)
{
- _bits |= 0x8000000L;
+ _bits |= 0x10000000L;
_headers._IfNoneMatch = value;
return true;
}
@@ -4991,9 +5067,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.AcceptCharset, key))
{
- if ((_bits & 0x100L) == 0)
+ if ((_bits & 0x200L) == 0)
{
- _bits |= 0x100L;
+ _bits |= 0x200L;
_headers._AcceptCharset = value;
return true;
}
@@ -5011,9 +5087,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.AcceptCharset.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x100L) == 0)
+ if ((_bits & 0x200L) == 0)
{
- _bits |= 0x100L;
+ _bits |= 0x200L;
_headers._AcceptCharset = value;
return true;
}
@@ -5034,9 +5110,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.AcceptEncoding, key))
{
- if ((_bits & 0x200L) == 0)
+ if ((_bits & 0x400L) == 0)
{
- _bits |= 0x200L;
+ _bits |= 0x400L;
_headers._AcceptEncoding = value;
return true;
}
@@ -5044,9 +5120,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.AcceptLanguage, key))
{
- if ((_bits & 0x400L) == 0)
+ if ((_bits & 0x800L) == 0)
{
- _bits |= 0x400L;
+ _bits |= 0x800L;
_headers._AcceptLanguage = value;
return true;
}
@@ -5055,9 +5131,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.AcceptEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x200L) == 0)
+ if ((_bits & 0x400L) == 0)
{
- _bits |= 0x200L;
+ _bits |= 0x400L;
_headers._AcceptEncoding = value;
return true;
}
@@ -5065,9 +5141,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.AcceptLanguage.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x400L) == 0)
+ if ((_bits & 0x800L) == 0)
{
- _bits |= 0x400L;
+ _bits |= 0x800L;
_headers._AcceptLanguage = value;
return true;
}
@@ -5079,9 +5155,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.IfModifiedSince, key))
{
- if ((_bits & 0x4000000L) == 0)
+ if ((_bits & 0x8000000L) == 0)
{
- _bits |= 0x4000000L;
+ _bits |= 0x8000000L;
_headers._IfModifiedSince = value;
return true;
}
@@ -5089,9 +5165,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.TransferEncoding, key))
{
- if ((_bits & 0x20000000000L) == 0)
+ if ((_bits & 0x40000000000L) == 0)
{
- _bits |= 0x20000000000L;
+ _bits |= 0x40000000000L;
_headers._TransferEncoding = value;
return true;
}
@@ -5100,9 +5176,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.IfModifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x4000000L) == 0)
+ if ((_bits & 0x8000000L) == 0)
{
- _bits |= 0x4000000L;
+ _bits |= 0x8000000L;
_headers._IfModifiedSince = value;
return true;
}
@@ -5110,9 +5186,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.TransferEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x20000000000L) == 0)
+ if ((_bits & 0x40000000000L) == 0)
{
- _bits |= 0x20000000000L;
+ _bits |= 0x40000000000L;
_headers._TransferEncoding = value;
return true;
}
@@ -5124,9 +5200,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.CorrelationContext, key))
{
- if ((_bits & 0x40000L) == 0)
+ if ((_bits & 0x80000L) == 0)
{
- _bits |= 0x40000L;
+ _bits |= 0x80000L;
_headers._CorrelationContext = value;
return true;
}
@@ -5134,9 +5210,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.IfUnmodifiedSince, key))
{
- if ((_bits & 0x20000000L) == 0)
+ if ((_bits & 0x40000000L) == 0)
{
- _bits |= 0x20000000L;
+ _bits |= 0x40000000L;
_headers._IfUnmodifiedSince = value;
return true;
}
@@ -5144,9 +5220,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.ProxyAuthorization, key))
{
- if ((_bits & 0x400000000L) == 0)
+ if ((_bits & 0x800000000L) == 0)
{
- _bits |= 0x400000000L;
+ _bits |= 0x800000000L;
_headers._ProxyAuthorization = value;
return true;
}
@@ -5155,9 +5231,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.CorrelationContext.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x40000L) == 0)
+ if ((_bits & 0x80000L) == 0)
{
- _bits |= 0x40000L;
+ _bits |= 0x80000L;
_headers._CorrelationContext = value;
return true;
}
@@ -5165,9 +5241,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.IfUnmodifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x20000000L) == 0)
+ if ((_bits & 0x40000000L) == 0)
{
- _bits |= 0x20000000L;
+ _bits |= 0x40000000L;
_headers._IfUnmodifiedSince = value;
return true;
}
@@ -5175,9 +5251,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.ProxyAuthorization.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x400000000L) == 0)
+ if ((_bits & 0x800000000L) == 0)
{
- _bits |= 0x400000000L;
+ _bits |= 0x800000000L;
_headers._ProxyAuthorization = value;
return true;
}
@@ -5189,9 +5265,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.GrpcAcceptEncoding, key))
{
- if ((_bits & 0x400000L) == 0)
+ if ((_bits & 0x800000L) == 0)
{
- _bits |= 0x400000L;
+ _bits |= 0x800000L;
_headers._GrpcAcceptEncoding = value;
return true;
}
@@ -5200,9 +5276,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.GrpcAcceptEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x400000L) == 0)
+ if ((_bits & 0x800000L) == 0)
{
- _bits |= 0x400000L;
+ _bits |= 0x800000L;
_headers._GrpcAcceptEncoding = value;
return true;
}
@@ -5214,9 +5290,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.UpgradeInsecureRequests, key))
{
- if ((_bits & 0x100000000000L) == 0)
+ if ((_bits & 0x200000000000L) == 0)
{
- _bits |= 0x100000000000L;
+ _bits |= 0x200000000000L;
_headers._UpgradeInsecureRequests = value;
return true;
}
@@ -5225,9 +5301,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.UpgradeInsecureRequests.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x100000000000L) == 0)
+ if ((_bits & 0x200000000000L) == 0)
{
- _bits |= 0x100000000000L;
+ _bits |= 0x200000000000L;
_headers._UpgradeInsecureRequests = value;
return true;
}
@@ -5239,9 +5315,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.AccessControlRequestMethod, key))
{
- if ((_bits & 0x1000L) == 0)
+ if ((_bits & 0x2000L) == 0)
{
- _bits |= 0x1000L;
+ _bits |= 0x2000L;
_headers._AccessControlRequestMethod = value;
return true;
}
@@ -5250,9 +5326,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.AccessControlRequestMethod.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x1000L) == 0)
+ if ((_bits & 0x2000L) == 0)
{
- _bits |= 0x1000L;
+ _bits |= 0x2000L;
_headers._AccessControlRequestMethod = value;
return true;
}
@@ -5264,9 +5340,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.AccessControlRequestHeaders, key))
{
- if ((_bits & 0x800L) == 0)
+ if ((_bits & 0x1000L) == 0)
{
- _bits |= 0x800L;
+ _bits |= 0x1000L;
_headers._AccessControlRequestHeaders = value;
return true;
}
@@ -5275,9 +5351,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.AccessControlRequestHeaders.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x800L) == 0)
+ if ((_bits & 0x1000L) == 0)
{
- _bits |= 0x800L;
+ _bits |= 0x1000L;
_headers._AccessControlRequestHeaders = value;
return true;
}
@@ -5298,9 +5374,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.TE, key))
{
- if ((_bits & 0x4000000000L) != 0)
+ if ((_bits & 0x8000000000L) != 0)
{
- _bits &= ~0x4000000000L;
+ _bits &= ~0x8000000000L;
_headers._TE = default(StringValues);
return true;
}
@@ -5309,9 +5385,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.TE.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x4000000000L) != 0)
+ if ((_bits & 0x8000000000L) != 0)
{
- _bits &= ~0x4000000000L;
+ _bits &= ~0x8000000000L;
_headers._TE = default(StringValues);
return true;
}
@@ -5323,9 +5399,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.Via, key))
{
- if ((_bits & 0x200000000000L) != 0)
+ if ((_bits & 0x400000000000L) != 0)
{
- _bits &= ~0x200000000000L;
+ _bits &= ~0x400000000000L;
_headers._Via = default(StringValues);
return true;
}
@@ -5334,9 +5410,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.Via.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x200000000000L) != 0)
+ if ((_bits & 0x400000000000L) != 0)
{
- _bits &= ~0x200000000000L;
+ _bits &= ~0x400000000000L;
_headers._Via = default(StringValues);
return true;
}
@@ -5358,9 +5434,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Date, key))
{
- if ((_bits & 0x80000L) != 0)
+ if ((_bits & 0x100000L) != 0)
{
- _bits &= ~0x80000L;
+ _bits &= ~0x100000L;
_headers._Date = default(StringValues);
return true;
}
@@ -5368,9 +5444,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.From, key))
{
- if ((_bits & 0x200000L) != 0)
+ if ((_bits & 0x400000L) != 0)
{
- _bits &= ~0x200000L;
+ _bits &= ~0x400000L;
_headers._From = default(StringValues);
return true;
}
@@ -5389,9 +5465,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Date.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x80000L) != 0)
+ if ((_bits & 0x100000L) != 0)
{
- _bits &= ~0x80000L;
+ _bits &= ~0x100000L;
_headers._Date = default(StringValues);
return true;
}
@@ -5399,9 +5475,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.From.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x200000L) != 0)
+ if ((_bits & 0x400000L) != 0)
{
- _bits &= ~0x200000L;
+ _bits &= ~0x400000L;
_headers._From = default(StringValues);
return true;
}
@@ -5423,9 +5499,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Range, key))
{
- if ((_bits & 0x800000000L) != 0)
+ if ((_bits & 0x1000000000L) != 0)
{
- _bits &= ~0x800000000L;
+ _bits &= ~0x1000000000L;
_headers._Range = default(StringValues);
return true;
}
@@ -5444,9 +5520,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Range.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x800000000L) != 0)
+ if ((_bits & 0x1000000000L) != 0)
{
- _bits &= ~0x800000000L;
+ _bits &= ~0x1000000000L;
_headers._Range = default(StringValues);
return true;
}
@@ -5468,9 +5544,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Cookie, key))
{
- if ((_bits & 0x20000L) != 0)
+ if ((_bits & 0x40000L) != 0)
{
- _bits &= ~0x20000L;
+ _bits &= ~0x40000L;
_headers._Cookie = default(StringValues);
return true;
}
@@ -5478,9 +5554,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Expect, key))
{
- if ((_bits & 0x100000L) != 0)
+ if ((_bits & 0x200000L) != 0)
{
- _bits &= ~0x100000L;
+ _bits &= ~0x200000L;
_headers._Expect = default(StringValues);
return true;
}
@@ -5488,9 +5564,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Origin, key))
{
- if ((_bits & 0x100000000L) != 0)
+ if ((_bits & 0x200000000L) != 0)
{
- _bits &= ~0x100000000L;
+ _bits &= ~0x200000000L;
_headers._Origin = default(StringValues);
return true;
}
@@ -5498,9 +5574,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Pragma, key))
{
- if ((_bits & 0x200000000L) != 0)
+ if ((_bits & 0x400000000L) != 0)
{
- _bits &= ~0x200000000L;
+ _bits &= ~0x400000000L;
_headers._Pragma = default(StringValues);
return true;
}
@@ -5519,9 +5595,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Cookie.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x20000L) != 0)
+ if ((_bits & 0x40000L) != 0)
{
- _bits &= ~0x20000L;
+ _bits &= ~0x40000L;
_headers._Cookie = default(StringValues);
return true;
}
@@ -5529,9 +5605,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Expect.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x100000L) != 0)
+ if ((_bits & 0x200000L) != 0)
{
- _bits &= ~0x100000L;
+ _bits &= ~0x200000L;
_headers._Expect = default(StringValues);
return true;
}
@@ -5539,9 +5615,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Origin.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x100000000L) != 0)
+ if ((_bits & 0x200000000L) != 0)
{
- _bits &= ~0x100000000L;
+ _bits &= ~0x200000000L;
_headers._Origin = default(StringValues);
return true;
}
@@ -5549,9 +5625,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Pragma.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x200000000L) != 0)
+ if ((_bits & 0x400000000L) != 0)
{
- _bits &= ~0x200000000L;
+ _bits &= ~0x400000000L;
_headers._Pragma = default(StringValues);
return true;
}
@@ -5573,9 +5649,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Scheme, key))
{
- if ((_bits & 0x80L) != 0)
+ if ((_bits & 0x100L) != 0)
{
- _bits &= ~0x80L;
+ _bits &= ~0x100L;
_headers._Scheme = default(StringValues);
return true;
}
@@ -5583,9 +5659,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Baggage, key))
{
- if ((_bits & 0x4000L) != 0)
+ if ((_bits & 0x8000L) != 0)
{
- _bits &= ~0x4000L;
+ _bits &= ~0x8000L;
_headers._Baggage = default(StringValues);
return true;
}
@@ -5593,9 +5669,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Referer, key))
{
- if ((_bits & 0x1000000000L) != 0)
+ if ((_bits & 0x2000000000L) != 0)
{
- _bits &= ~0x1000000000L;
+ _bits &= ~0x2000000000L;
_headers._Referer = default(StringValues);
return true;
}
@@ -5603,9 +5679,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Upgrade, key))
{
- if ((_bits & 0x80000000000L) != 0)
+ if ((_bits & 0x100000000000L) != 0)
{
- _bits &= ~0x80000000000L;
+ _bits &= ~0x100000000000L;
_headers._Upgrade = default(StringValues);
return true;
}
@@ -5613,9 +5689,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.Warning, key))
{
- if ((_bits & 0x400000000000L) != 0)
+ if ((_bits & 0x800000000000L) != 0)
{
- _bits &= ~0x400000000000L;
+ _bits &= ~0x800000000000L;
_headers._Warning = default(StringValues);
return true;
}
@@ -5634,9 +5710,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Scheme.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x80L) != 0)
+ if ((_bits & 0x100L) != 0)
{
- _bits &= ~0x80L;
+ _bits &= ~0x100L;
_headers._Scheme = default(StringValues);
return true;
}
@@ -5644,9 +5720,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Baggage.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x4000L) != 0)
+ if ((_bits & 0x8000L) != 0)
{
- _bits &= ~0x4000L;
+ _bits &= ~0x8000L;
_headers._Baggage = default(StringValues);
return true;
}
@@ -5654,9 +5730,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Referer.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x1000000000L) != 0)
+ if ((_bits & 0x2000000000L) != 0)
{
- _bits &= ~0x1000000000L;
+ _bits &= ~0x2000000000L;
_headers._Referer = default(StringValues);
return true;
}
@@ -5664,9 +5740,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Upgrade.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x80000000000L) != 0)
+ if ((_bits & 0x100000000000L) != 0)
{
- _bits &= ~0x80000000000L;
+ _bits &= ~0x100000000000L;
_headers._Upgrade = default(StringValues);
return true;
}
@@ -5674,9 +5750,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.Warning.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x400000000000L) != 0)
+ if ((_bits & 0x800000000000L) != 0)
{
- _bits &= ~0x400000000000L;
+ _bits &= ~0x800000000000L;
_headers._Warning = default(StringValues);
return true;
}
@@ -5688,9 +5764,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.IfMatch, key))
{
- if ((_bits & 0x2000000L) != 0)
+ if ((_bits & 0x4000000L) != 0)
{
- _bits &= ~0x2000000L;
+ _bits &= ~0x4000000L;
_headers._IfMatch = default(StringValues);
return true;
}
@@ -5698,9 +5774,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.IfRange, key))
{
- if ((_bits & 0x10000000L) != 0)
+ if ((_bits & 0x20000000L) != 0)
{
- _bits &= ~0x10000000L;
+ _bits &= ~0x20000000L;
_headers._IfRange = default(StringValues);
return true;
}
@@ -5709,9 +5785,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.IfMatch.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x2000000L) != 0)
+ if ((_bits & 0x4000000L) != 0)
{
- _bits &= ~0x2000000L;
+ _bits &= ~0x4000000L;
_headers._IfMatch = default(StringValues);
return true;
}
@@ -5719,9 +5795,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.IfRange.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x10000000L) != 0)
+ if ((_bits & 0x20000000L) != 0)
{
- _bits &= ~0x10000000L;
+ _bits &= ~0x20000000L;
_headers._IfRange = default(StringValues);
return true;
}
@@ -5731,22 +5807,42 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
case 9:
{
+ if (ReferenceEquals(HeaderNames.Protocol, key))
+ {
+ if ((_bits & 0x80L) != 0)
+ {
+ _bits &= ~0x80L;
+ _headers._Protocol = default(StringValues);
+ return true;
+ }
+ return false;
+ }
if (ReferenceEquals(HeaderNames.Translate, key))
{
- if ((_bits & 0x40000000000L) != 0)
+ if ((_bits & 0x80000000000L) != 0)
{
- _bits &= ~0x40000000000L;
+ _bits &= ~0x80000000000L;
_headers._Translate = default(StringValues);
return true;
}
return false;
}
+ if (HeaderNames.Protocol.Equals(key, StringComparison.OrdinalIgnoreCase))
+ {
+ if ((_bits & 0x80L) != 0)
+ {
+ _bits &= ~0x80L;
+ _headers._Protocol = default(StringValues);
+ return true;
+ }
+ return false;
+ }
if (HeaderNames.Translate.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x40000000000L) != 0)
+ if ((_bits & 0x80000000000L) != 0)
{
- _bits &= ~0x40000000000L;
+ _bits &= ~0x80000000000L;
_headers._Translate = default(StringValues);
return true;
}
@@ -5788,9 +5884,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.KeepAlive, key))
{
- if ((_bits & 0x40000000L) != 0)
+ if ((_bits & 0x80000000L) != 0)
{
- _bits &= ~0x40000000L;
+ _bits &= ~0x80000000L;
_headers._KeepAlive = default(StringValues);
return true;
}
@@ -5798,9 +5894,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.RequestId, key))
{
- if ((_bits & 0x2000000000L) != 0)
+ if ((_bits & 0x4000000000L) != 0)
{
- _bits &= ~0x2000000000L;
+ _bits &= ~0x4000000000L;
_headers._RequestId = default(StringValues);
return true;
}
@@ -5808,9 +5904,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.TraceState, key))
{
- if ((_bits & 0x10000000000L) != 0)
+ if ((_bits & 0x20000000000L) != 0)
{
- _bits &= ~0x10000000000L;
+ _bits &= ~0x20000000000L;
_headers._TraceState = default(StringValues);
return true;
}
@@ -5849,9 +5945,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.KeepAlive.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x40000000L) != 0)
+ if ((_bits & 0x80000000L) != 0)
{
- _bits &= ~0x40000000L;
+ _bits &= ~0x80000000L;
_headers._KeepAlive = default(StringValues);
return true;
}
@@ -5859,9 +5955,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.RequestId.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x2000000000L) != 0)
+ if ((_bits & 0x4000000000L) != 0)
{
- _bits &= ~0x2000000000L;
+ _bits &= ~0x4000000000L;
_headers._RequestId = default(StringValues);
return true;
}
@@ -5869,9 +5965,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.TraceState.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x10000000000L) != 0)
+ if ((_bits & 0x20000000000L) != 0)
{
- _bits &= ~0x10000000000L;
+ _bits &= ~0x20000000000L;
_headers._TraceState = default(StringValues);
return true;
}
@@ -5883,9 +5979,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.TraceParent, key))
{
- if ((_bits & 0x8000000000L) != 0)
+ if ((_bits & 0x10000000000L) != 0)
{
- _bits &= ~0x8000000000L;
+ _bits &= ~0x10000000000L;
_headers._TraceParent = default(StringValues);
return true;
}
@@ -5894,9 +5990,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.TraceParent.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x8000000000L) != 0)
+ if ((_bits & 0x10000000000L) != 0)
{
- _bits &= ~0x8000000000L;
+ _bits &= ~0x10000000000L;
_headers._TraceParent = default(StringValues);
return true;
}
@@ -5908,9 +6004,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.ContentType, key))
{
- if ((_bits & 0x10000L) != 0)
+ if ((_bits & 0x20000L) != 0)
{
- _bits &= ~0x10000L;
+ _bits &= ~0x20000L;
_headers._ContentType = default(StringValues);
return true;
}
@@ -5918,9 +6014,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.GrpcTimeout, key))
{
- if ((_bits & 0x1000000L) != 0)
+ if ((_bits & 0x2000000L) != 0)
{
- _bits &= ~0x1000000L;
+ _bits &= ~0x2000000L;
_headers._GrpcTimeout = default(StringValues);
return true;
}
@@ -5928,9 +6024,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.MaxForwards, key))
{
- if ((_bits & 0x80000000L) != 0)
+ if ((_bits & 0x100000000L) != 0)
{
- _bits &= ~0x80000000L;
+ _bits &= ~0x100000000L;
_headers._MaxForwards = default(StringValues);
return true;
}
@@ -5939,9 +6035,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.ContentType.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x10000L) != 0)
+ if ((_bits & 0x20000L) != 0)
{
- _bits &= ~0x10000L;
+ _bits &= ~0x20000L;
_headers._ContentType = default(StringValues);
return true;
}
@@ -5949,9 +6045,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.GrpcTimeout.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x1000000L) != 0)
+ if ((_bits & 0x2000000L) != 0)
{
- _bits &= ~0x1000000L;
+ _bits &= ~0x2000000L;
_headers._GrpcTimeout = default(StringValues);
return true;
}
@@ -5959,9 +6055,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.MaxForwards.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x80000000L) != 0)
+ if ((_bits & 0x100000000L) != 0)
{
- _bits &= ~0x80000000L;
+ _bits &= ~0x100000000L;
_headers._MaxForwards = default(StringValues);
return true;
}
@@ -5973,9 +6069,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.Authorization, key))
{
- if ((_bits & 0x2000L) != 0)
+ if ((_bits & 0x4000L) != 0)
{
- _bits &= ~0x2000L;
+ _bits &= ~0x4000L;
_headers._Authorization = default(StringValues);
return true;
}
@@ -5983,9 +6079,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.CacheControl, key))
{
- if ((_bits & 0x8000L) != 0)
+ if ((_bits & 0x10000L) != 0)
{
- _bits &= ~0x8000L;
+ _bits &= ~0x10000L;
_headers._CacheControl = default(StringValues);
return true;
}
@@ -5993,9 +6089,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.GrpcEncoding, key))
{
- if ((_bits & 0x800000L) != 0)
+ if ((_bits & 0x1000000L) != 0)
{
- _bits &= ~0x800000L;
+ _bits &= ~0x1000000L;
_headers._GrpcEncoding = default(StringValues);
return true;
}
@@ -6003,9 +6099,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.IfNoneMatch, key))
{
- if ((_bits & 0x8000000L) != 0)
+ if ((_bits & 0x10000000L) != 0)
{
- _bits &= ~0x8000000L;
+ _bits &= ~0x10000000L;
_headers._IfNoneMatch = default(StringValues);
return true;
}
@@ -6014,9 +6110,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.Authorization.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x2000L) != 0)
+ if ((_bits & 0x4000L) != 0)
{
- _bits &= ~0x2000L;
+ _bits &= ~0x4000L;
_headers._Authorization = default(StringValues);
return true;
}
@@ -6024,9 +6120,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.CacheControl.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x8000L) != 0)
+ if ((_bits & 0x10000L) != 0)
{
- _bits &= ~0x8000L;
+ _bits &= ~0x10000L;
_headers._CacheControl = default(StringValues);
return true;
}
@@ -6034,9 +6130,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.GrpcEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x800000L) != 0)
+ if ((_bits & 0x1000000L) != 0)
{
- _bits &= ~0x800000L;
+ _bits &= ~0x1000000L;
_headers._GrpcEncoding = default(StringValues);
return true;
}
@@ -6044,9 +6140,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.IfNoneMatch.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x8000000L) != 0)
+ if ((_bits & 0x10000000L) != 0)
{
- _bits &= ~0x8000000L;
+ _bits &= ~0x10000000L;
_headers._IfNoneMatch = default(StringValues);
return true;
}
@@ -6058,9 +6154,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.AcceptCharset, key))
{
- if ((_bits & 0x100L) != 0)
+ if ((_bits & 0x200L) != 0)
{
- _bits &= ~0x100L;
+ _bits &= ~0x200L;
_headers._AcceptCharset = default(StringValues);
return true;
}
@@ -6078,9 +6174,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.AcceptCharset.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x100L) != 0)
+ if ((_bits & 0x200L) != 0)
{
- _bits &= ~0x100L;
+ _bits &= ~0x200L;
_headers._AcceptCharset = default(StringValues);
return true;
}
@@ -6101,9 +6197,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.AcceptEncoding, key))
{
- if ((_bits & 0x200L) != 0)
+ if ((_bits & 0x400L) != 0)
{
- _bits &= ~0x200L;
+ _bits &= ~0x400L;
_headers._AcceptEncoding = default(StringValues);
return true;
}
@@ -6111,9 +6207,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.AcceptLanguage, key))
{
- if ((_bits & 0x400L) != 0)
+ if ((_bits & 0x800L) != 0)
{
- _bits &= ~0x400L;
+ _bits &= ~0x800L;
_headers._AcceptLanguage = default(StringValues);
return true;
}
@@ -6122,9 +6218,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.AcceptEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x200L) != 0)
+ if ((_bits & 0x400L) != 0)
{
- _bits &= ~0x200L;
+ _bits &= ~0x400L;
_headers._AcceptEncoding = default(StringValues);
return true;
}
@@ -6132,9 +6228,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.AcceptLanguage.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x400L) != 0)
+ if ((_bits & 0x800L) != 0)
{
- _bits &= ~0x400L;
+ _bits &= ~0x800L;
_headers._AcceptLanguage = default(StringValues);
return true;
}
@@ -6146,9 +6242,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.IfModifiedSince, key))
{
- if ((_bits & 0x4000000L) != 0)
+ if ((_bits & 0x8000000L) != 0)
{
- _bits &= ~0x4000000L;
+ _bits &= ~0x8000000L;
_headers._IfModifiedSince = default(StringValues);
return true;
}
@@ -6156,9 +6252,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.TransferEncoding, key))
{
- if ((_bits & 0x20000000000L) != 0)
+ if ((_bits & 0x40000000000L) != 0)
{
- _bits &= ~0x20000000000L;
+ _bits &= ~0x40000000000L;
_headers._TransferEncoding = default(StringValues);
return true;
}
@@ -6167,9 +6263,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.IfModifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x4000000L) != 0)
+ if ((_bits & 0x8000000L) != 0)
{
- _bits &= ~0x4000000L;
+ _bits &= ~0x8000000L;
_headers._IfModifiedSince = default(StringValues);
return true;
}
@@ -6177,9 +6273,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.TransferEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x20000000000L) != 0)
+ if ((_bits & 0x40000000000L) != 0)
{
- _bits &= ~0x20000000000L;
+ _bits &= ~0x40000000000L;
_headers._TransferEncoding = default(StringValues);
return true;
}
@@ -6191,9 +6287,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.CorrelationContext, key))
{
- if ((_bits & 0x40000L) != 0)
+ if ((_bits & 0x80000L) != 0)
{
- _bits &= ~0x40000L;
+ _bits &= ~0x80000L;
_headers._CorrelationContext = default(StringValues);
return true;
}
@@ -6201,9 +6297,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.IfUnmodifiedSince, key))
{
- if ((_bits & 0x20000000L) != 0)
+ if ((_bits & 0x40000000L) != 0)
{
- _bits &= ~0x20000000L;
+ _bits &= ~0x40000000L;
_headers._IfUnmodifiedSince = default(StringValues);
return true;
}
@@ -6211,9 +6307,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (ReferenceEquals(HeaderNames.ProxyAuthorization, key))
{
- if ((_bits & 0x400000000L) != 0)
+ if ((_bits & 0x800000000L) != 0)
{
- _bits &= ~0x400000000L;
+ _bits &= ~0x800000000L;
_headers._ProxyAuthorization = default(StringValues);
return true;
}
@@ -6222,9 +6318,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.CorrelationContext.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x40000L) != 0)
+ if ((_bits & 0x80000L) != 0)
{
- _bits &= ~0x40000L;
+ _bits &= ~0x80000L;
_headers._CorrelationContext = default(StringValues);
return true;
}
@@ -6232,9 +6328,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.IfUnmodifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x20000000L) != 0)
+ if ((_bits & 0x40000000L) != 0)
{
- _bits &= ~0x20000000L;
+ _bits &= ~0x40000000L;
_headers._IfUnmodifiedSince = default(StringValues);
return true;
}
@@ -6242,9 +6338,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
if (HeaderNames.ProxyAuthorization.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x400000000L) != 0)
+ if ((_bits & 0x800000000L) != 0)
{
- _bits &= ~0x400000000L;
+ _bits &= ~0x800000000L;
_headers._ProxyAuthorization = default(StringValues);
return true;
}
@@ -6256,9 +6352,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.GrpcAcceptEncoding, key))
{
- if ((_bits & 0x400000L) != 0)
+ if ((_bits & 0x800000L) != 0)
{
- _bits &= ~0x400000L;
+ _bits &= ~0x800000L;
_headers._GrpcAcceptEncoding = default(StringValues);
return true;
}
@@ -6267,9 +6363,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.GrpcAcceptEncoding.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x400000L) != 0)
+ if ((_bits & 0x800000L) != 0)
{
- _bits &= ~0x400000L;
+ _bits &= ~0x800000L;
_headers._GrpcAcceptEncoding = default(StringValues);
return true;
}
@@ -6281,9 +6377,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.UpgradeInsecureRequests, key))
{
- if ((_bits & 0x100000000000L) != 0)
+ if ((_bits & 0x200000000000L) != 0)
{
- _bits &= ~0x100000000000L;
+ _bits &= ~0x200000000000L;
_headers._UpgradeInsecureRequests = default(StringValues);
return true;
}
@@ -6292,9 +6388,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.UpgradeInsecureRequests.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x100000000000L) != 0)
+ if ((_bits & 0x200000000000L) != 0)
{
- _bits &= ~0x100000000000L;
+ _bits &= ~0x200000000000L;
_headers._UpgradeInsecureRequests = default(StringValues);
return true;
}
@@ -6306,9 +6402,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.AccessControlRequestMethod, key))
{
- if ((_bits & 0x1000L) != 0)
+ if ((_bits & 0x2000L) != 0)
{
- _bits &= ~0x1000L;
+ _bits &= ~0x2000L;
_headers._AccessControlRequestMethod = default(StringValues);
return true;
}
@@ -6317,9 +6413,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.AccessControlRequestMethod.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x1000L) != 0)
+ if ((_bits & 0x2000L) != 0)
{
- _bits &= ~0x1000L;
+ _bits &= ~0x2000L;
_headers._AccessControlRequestMethod = default(StringValues);
return true;
}
@@ -6331,9 +6427,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
if (ReferenceEquals(HeaderNames.AccessControlRequestHeaders, key))
{
- if ((_bits & 0x800L) != 0)
+ if ((_bits & 0x1000L) != 0)
{
- _bits &= ~0x800L;
+ _bits &= ~0x1000L;
_headers._AccessControlRequestHeaders = default(StringValues);
return true;
}
@@ -6342,9 +6438,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if (HeaderNames.AccessControlRequestHeaders.Equals(key, StringComparison.OrdinalIgnoreCase))
{
- if ((_bits & 0x800L) != 0)
+ if ((_bits & 0x1000L) != 0)
{
- _bits &= ~0x800L;
+ _bits &= ~0x1000L;
_headers._AccessControlRequestHeaders = default(StringValues);
return true;
}
@@ -6432,7 +6528,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x80L) != 0)
{
- _headers._Scheme = default;
+ _headers._Protocol = default;
if((tempBits & ~0x80L) == 0)
{
return;
@@ -6442,7 +6538,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x100L) != 0)
{
- _headers._AcceptCharset = default;
+ _headers._Scheme = default;
if((tempBits & ~0x100L) == 0)
{
return;
@@ -6452,7 +6548,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x200L) != 0)
{
- _headers._AcceptEncoding = default;
+ _headers._AcceptCharset = default;
if((tempBits & ~0x200L) == 0)
{
return;
@@ -6462,7 +6558,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x400L) != 0)
{
- _headers._AcceptLanguage = default;
+ _headers._AcceptEncoding = default;
if((tempBits & ~0x400L) == 0)
{
return;
@@ -6472,7 +6568,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x800L) != 0)
{
- _headers._AccessControlRequestHeaders = default;
+ _headers._AcceptLanguage = default;
if((tempBits & ~0x800L) == 0)
{
return;
@@ -6482,7 +6578,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x1000L) != 0)
{
- _headers._AccessControlRequestMethod = default;
+ _headers._AccessControlRequestHeaders = default;
if((tempBits & ~0x1000L) == 0)
{
return;
@@ -6492,7 +6588,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x2000L) != 0)
{
- _headers._Authorization = default;
+ _headers._AccessControlRequestMethod = default;
if((tempBits & ~0x2000L) == 0)
{
return;
@@ -6502,7 +6598,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x4000L) != 0)
{
- _headers._Baggage = default;
+ _headers._Authorization = default;
if((tempBits & ~0x4000L) == 0)
{
return;
@@ -6512,7 +6608,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x8000L) != 0)
{
- _headers._CacheControl = default;
+ _headers._Baggage = default;
if((tempBits & ~0x8000L) == 0)
{
return;
@@ -6522,7 +6618,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x10000L) != 0)
{
- _headers._ContentType = default;
+ _headers._CacheControl = default;
if((tempBits & ~0x10000L) == 0)
{
return;
@@ -6532,7 +6628,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x20000L) != 0)
{
- _headers._Cookie = default;
+ _headers._ContentType = default;
if((tempBits & ~0x20000L) == 0)
{
return;
@@ -6542,7 +6638,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x40000L) != 0)
{
- _headers._CorrelationContext = default;
+ _headers._Cookie = default;
if((tempBits & ~0x40000L) == 0)
{
return;
@@ -6552,7 +6648,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x80000L) != 0)
{
- _headers._Date = default;
+ _headers._CorrelationContext = default;
if((tempBits & ~0x80000L) == 0)
{
return;
@@ -6562,7 +6658,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x100000L) != 0)
{
- _headers._Expect = default;
+ _headers._Date = default;
if((tempBits & ~0x100000L) == 0)
{
return;
@@ -6572,7 +6668,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x200000L) != 0)
{
- _headers._From = default;
+ _headers._Expect = default;
if((tempBits & ~0x200000L) == 0)
{
return;
@@ -6582,7 +6678,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x400000L) != 0)
{
- _headers._GrpcAcceptEncoding = default;
+ _headers._From = default;
if((tempBits & ~0x400000L) == 0)
{
return;
@@ -6592,7 +6688,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x800000L) != 0)
{
- _headers._GrpcEncoding = default;
+ _headers._GrpcAcceptEncoding = default;
if((tempBits & ~0x800000L) == 0)
{
return;
@@ -6602,7 +6698,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x1000000L) != 0)
{
- _headers._GrpcTimeout = default;
+ _headers._GrpcEncoding = default;
if((tempBits & ~0x1000000L) == 0)
{
return;
@@ -6612,7 +6708,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x2000000L) != 0)
{
- _headers._IfMatch = default;
+ _headers._GrpcTimeout = default;
if((tempBits & ~0x2000000L) == 0)
{
return;
@@ -6622,7 +6718,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x4000000L) != 0)
{
- _headers._IfModifiedSince = default;
+ _headers._IfMatch = default;
if((tempBits & ~0x4000000L) == 0)
{
return;
@@ -6632,7 +6728,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x8000000L) != 0)
{
- _headers._IfNoneMatch = default;
+ _headers._IfModifiedSince = default;
if((tempBits & ~0x8000000L) == 0)
{
return;
@@ -6642,7 +6738,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x10000000L) != 0)
{
- _headers._IfRange = default;
+ _headers._IfNoneMatch = default;
if((tempBits & ~0x10000000L) == 0)
{
return;
@@ -6652,7 +6748,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x20000000L) != 0)
{
- _headers._IfUnmodifiedSince = default;
+ _headers._IfRange = default;
if((tempBits & ~0x20000000L) == 0)
{
return;
@@ -6662,7 +6758,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x40000000L) != 0)
{
- _headers._KeepAlive = default;
+ _headers._IfUnmodifiedSince = default;
if((tempBits & ~0x40000000L) == 0)
{
return;
@@ -6672,7 +6768,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x80000000L) != 0)
{
- _headers._MaxForwards = default;
+ _headers._KeepAlive = default;
if((tempBits & ~0x80000000L) == 0)
{
return;
@@ -6682,7 +6778,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x100000000L) != 0)
{
- _headers._Origin = default;
+ _headers._MaxForwards = default;
if((tempBits & ~0x100000000L) == 0)
{
return;
@@ -6692,7 +6788,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x200000000L) != 0)
{
- _headers._Pragma = default;
+ _headers._Origin = default;
if((tempBits & ~0x200000000L) == 0)
{
return;
@@ -6702,7 +6798,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x400000000L) != 0)
{
- _headers._ProxyAuthorization = default;
+ _headers._Pragma = default;
if((tempBits & ~0x400000000L) == 0)
{
return;
@@ -6712,7 +6808,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x800000000L) != 0)
{
- _headers._Range = default;
+ _headers._ProxyAuthorization = default;
if((tempBits & ~0x800000000L) == 0)
{
return;
@@ -6722,7 +6818,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x1000000000L) != 0)
{
- _headers._Referer = default;
+ _headers._Range = default;
if((tempBits & ~0x1000000000L) == 0)
{
return;
@@ -6732,7 +6828,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x2000000000L) != 0)
{
- _headers._RequestId = default;
+ _headers._Referer = default;
if((tempBits & ~0x2000000000L) == 0)
{
return;
@@ -6742,7 +6838,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x4000000000L) != 0)
{
- _headers._TE = default;
+ _headers._RequestId = default;
if((tempBits & ~0x4000000000L) == 0)
{
return;
@@ -6752,7 +6848,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x8000000000L) != 0)
{
- _headers._TraceParent = default;
+ _headers._TE = default;
if((tempBits & ~0x8000000000L) == 0)
{
return;
@@ -6762,7 +6858,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x10000000000L) != 0)
{
- _headers._TraceState = default;
+ _headers._TraceParent = default;
if((tempBits & ~0x10000000000L) == 0)
{
return;
@@ -6772,7 +6868,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x20000000000L) != 0)
{
- _headers._TransferEncoding = default;
+ _headers._TraceState = default;
if((tempBits & ~0x20000000000L) == 0)
{
return;
@@ -6782,7 +6878,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x40000000000L) != 0)
{
- _headers._Translate = default;
+ _headers._TransferEncoding = default;
if((tempBits & ~0x40000000000L) == 0)
{
return;
@@ -6792,7 +6888,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x80000000000L) != 0)
{
- _headers._Upgrade = default;
+ _headers._Translate = default;
if((tempBits & ~0x80000000000L) == 0)
{
return;
@@ -6802,7 +6898,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x100000000000L) != 0)
{
- _headers._UpgradeInsecureRequests = default;
+ _headers._Upgrade = default;
if((tempBits & ~0x100000000000L) == 0)
{
return;
@@ -6812,7 +6908,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x200000000000L) != 0)
{
- _headers._Via = default;
+ _headers._UpgradeInsecureRequests = default;
if((tempBits & ~0x200000000000L) == 0)
{
return;
@@ -6822,7 +6918,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
if ((tempBits & 0x400000000000L) != 0)
{
- _headers._Warning = default;
+ _headers._Via = default;
if((tempBits & ~0x400000000000L) == 0)
{
return;
@@ -6830,6 +6926,16 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
tempBits &= ~0x400000000000L;
}
+ if ((tempBits & 0x800000000000L) != 0)
+ {
+ _headers._Warning = default;
+ if((tempBits & ~0x800000000000L) == 0)
+ {
+ return;
+ }
+ tempBits &= ~0x800000000000L;
+ }
+
}
protected override bool CopyToFast(KeyValuePair<string, StringValues>[] array, int arrayIndex)
@@ -6908,7 +7014,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Scheme, _headers._Scheme);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Protocol, _headers._Protocol);
++arrayIndex;
}
if ((_bits & 0x100L) != 0)
@@ -6917,7 +7023,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.AcceptCharset, _headers._AcceptCharset);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Scheme, _headers._Scheme);
++arrayIndex;
}
if ((_bits & 0x200L) != 0)
@@ -6926,7 +7032,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.AcceptEncoding, _headers._AcceptEncoding);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.AcceptCharset, _headers._AcceptCharset);
++arrayIndex;
}
if ((_bits & 0x400L) != 0)
@@ -6935,7 +7041,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.AcceptLanguage, _headers._AcceptLanguage);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.AcceptEncoding, _headers._AcceptEncoding);
++arrayIndex;
}
if ((_bits & 0x800L) != 0)
@@ -6944,7 +7050,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.AccessControlRequestHeaders, _headers._AccessControlRequestHeaders);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.AcceptLanguage, _headers._AcceptLanguage);
++arrayIndex;
}
if ((_bits & 0x1000L) != 0)
@@ -6953,7 +7059,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.AccessControlRequestMethod, _headers._AccessControlRequestMethod);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.AccessControlRequestHeaders, _headers._AccessControlRequestHeaders);
++arrayIndex;
}
if ((_bits & 0x2000L) != 0)
@@ -6962,7 +7068,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Authorization, _headers._Authorization);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.AccessControlRequestMethod, _headers._AccessControlRequestMethod);
++arrayIndex;
}
if ((_bits & 0x4000L) != 0)
@@ -6971,7 +7077,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Baggage, _headers._Baggage);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Authorization, _headers._Authorization);
++arrayIndex;
}
if ((_bits & 0x8000L) != 0)
@@ -6980,7 +7086,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.CacheControl, _headers._CacheControl);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Baggage, _headers._Baggage);
++arrayIndex;
}
if ((_bits & 0x10000L) != 0)
@@ -6989,7 +7095,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.ContentType, _headers._ContentType);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.CacheControl, _headers._CacheControl);
++arrayIndex;
}
if ((_bits & 0x20000L) != 0)
@@ -6998,7 +7104,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Cookie, _headers._Cookie);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.ContentType, _headers._ContentType);
++arrayIndex;
}
if ((_bits & 0x40000L) != 0)
@@ -7007,7 +7113,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.CorrelationContext, _headers._CorrelationContext);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Cookie, _headers._Cookie);
++arrayIndex;
}
if ((_bits & 0x80000L) != 0)
@@ -7016,7 +7122,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Date, _headers._Date);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.CorrelationContext, _headers._CorrelationContext);
++arrayIndex;
}
if ((_bits & 0x100000L) != 0)
@@ -7025,7 +7131,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Expect, _headers._Expect);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Date, _headers._Date);
++arrayIndex;
}
if ((_bits & 0x200000L) != 0)
@@ -7034,7 +7140,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.From, _headers._From);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Expect, _headers._Expect);
++arrayIndex;
}
if ((_bits & 0x400000L) != 0)
@@ -7043,7 +7149,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.GrpcAcceptEncoding, _headers._GrpcAcceptEncoding);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.From, _headers._From);
++arrayIndex;
}
if ((_bits & 0x800000L) != 0)
@@ -7052,7 +7158,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.GrpcEncoding, _headers._GrpcEncoding);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.GrpcAcceptEncoding, _headers._GrpcAcceptEncoding);
++arrayIndex;
}
if ((_bits & 0x1000000L) != 0)
@@ -7061,7 +7167,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.GrpcTimeout, _headers._GrpcTimeout);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.GrpcEncoding, _headers._GrpcEncoding);
++arrayIndex;
}
if ((_bits & 0x2000000L) != 0)
@@ -7070,7 +7176,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.IfMatch, _headers._IfMatch);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.GrpcTimeout, _headers._GrpcTimeout);
++arrayIndex;
}
if ((_bits & 0x4000000L) != 0)
@@ -7079,7 +7185,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.IfModifiedSince, _headers._IfModifiedSince);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.IfMatch, _headers._IfMatch);
++arrayIndex;
}
if ((_bits & 0x8000000L) != 0)
@@ -7088,7 +7194,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.IfNoneMatch, _headers._IfNoneMatch);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.IfModifiedSince, _headers._IfModifiedSince);
++arrayIndex;
}
if ((_bits & 0x10000000L) != 0)
@@ -7097,7 +7203,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.IfRange, _headers._IfRange);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.IfNoneMatch, _headers._IfNoneMatch);
++arrayIndex;
}
if ((_bits & 0x20000000L) != 0)
@@ -7106,7 +7212,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.IfUnmodifiedSince, _headers._IfUnmodifiedSince);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.IfRange, _headers._IfRange);
++arrayIndex;
}
if ((_bits & 0x40000000L) != 0)
@@ -7115,7 +7221,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.KeepAlive, _headers._KeepAlive);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.IfUnmodifiedSince, _headers._IfUnmodifiedSince);
++arrayIndex;
}
if ((_bits & 0x80000000L) != 0)
@@ -7124,7 +7230,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.MaxForwards, _headers._MaxForwards);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.KeepAlive, _headers._KeepAlive);
++arrayIndex;
}
if ((_bits & 0x100000000L) != 0)
@@ -7133,7 +7239,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Origin, _headers._Origin);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.MaxForwards, _headers._MaxForwards);
++arrayIndex;
}
if ((_bits & 0x200000000L) != 0)
@@ -7142,7 +7248,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Pragma, _headers._Pragma);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Origin, _headers._Origin);
++arrayIndex;
}
if ((_bits & 0x400000000L) != 0)
@@ -7151,7 +7257,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.ProxyAuthorization, _headers._ProxyAuthorization);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Pragma, _headers._Pragma);
++arrayIndex;
}
if ((_bits & 0x800000000L) != 0)
@@ -7160,7 +7266,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Range, _headers._Range);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.ProxyAuthorization, _headers._ProxyAuthorization);
++arrayIndex;
}
if ((_bits & 0x1000000000L) != 0)
@@ -7169,7 +7275,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Referer, _headers._Referer);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Range, _headers._Range);
++arrayIndex;
}
if ((_bits & 0x2000000000L) != 0)
@@ -7178,7 +7284,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.RequestId, _headers._RequestId);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Referer, _headers._Referer);
++arrayIndex;
}
if ((_bits & 0x4000000000L) != 0)
@@ -7187,7 +7293,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.TE, _headers._TE);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.RequestId, _headers._RequestId);
++arrayIndex;
}
if ((_bits & 0x8000000000L) != 0)
@@ -7196,7 +7302,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.TraceParent, _headers._TraceParent);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.TE, _headers._TE);
++arrayIndex;
}
if ((_bits & 0x10000000000L) != 0)
@@ -7205,7 +7311,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.TraceState, _headers._TraceState);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.TraceParent, _headers._TraceParent);
++arrayIndex;
}
if ((_bits & 0x20000000000L) != 0)
@@ -7214,7 +7320,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.TransferEncoding, _headers._TransferEncoding);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.TraceState, _headers._TraceState);
++arrayIndex;
}
if ((_bits & 0x40000000000L) != 0)
@@ -7223,7 +7329,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Translate, _headers._Translate);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.TransferEncoding, _headers._TransferEncoding);
++arrayIndex;
}
if ((_bits & 0x80000000000L) != 0)
@@ -7232,7 +7338,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Upgrade, _headers._Upgrade);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Translate, _headers._Translate);
++arrayIndex;
}
if ((_bits & 0x100000000000L) != 0)
@@ -7241,7 +7347,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.UpgradeInsecureRequests, _headers._UpgradeInsecureRequests);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Upgrade, _headers._Upgrade);
++arrayIndex;
}
if ((_bits & 0x200000000000L) != 0)
@@ -7250,7 +7356,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
- array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Via, _headers._Via);
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.UpgradeInsecureRequests, _headers._UpgradeInsecureRequests);
++arrayIndex;
}
if ((_bits & 0x400000000000L) != 0)
@@ -7259,6 +7365,15 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
return false;
}
+ array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Via, _headers._Via);
+ ++arrayIndex;
+ }
+ if ((_bits & 0x800000000000L) != 0)
+ {
+ if (arrayIndex == array.Length)
+ {
+ return false;
+ }
array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.Warning, _headers._Warning);
++arrayIndex;
}
@@ -7278,8 +7393,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
internal void ClearPseudoRequestHeaders()
{
- _pseudoBits = _bits & 240;
- _bits &= ~240;
+ _pseudoBits = _bits & 496;
+ _bits &= ~496;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -7326,7 +7441,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
case 2:
if (((ReadUnalignedLittleEndian_ushort(ref nameStart) & 0xdfdfu) == 0x4554u))
{
- flag = 0x4000000000L;
+ flag = 0x8000000000L;
values = ref _headers._TE;
nameStr = HeaderNames.TE;
}
@@ -7334,7 +7449,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
case 3:
if (((ReadUnalignedLittleEndian_ushort(ref nameStart) & 0xdfdfu) == 0x4956u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)2) & 0xdfu) == 0x41u))
{
- flag = 0x200000000000L;
+ flag = 0x400000000000L;
values = ref _headers._Via;
nameStr = HeaderNames.Via;
}
@@ -7349,13 +7464,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
else if ((firstTerm4 == 0x45544144u))
{
- flag = 0x80000L;
+ flag = 0x100000L;
values = ref _headers._Date;
nameStr = HeaderNames.Date;
}
else if ((firstTerm4 == 0x4d4f5246u))
{
- flag = 0x200000L;
+ flag = 0x400000L;
values = ref _headers._From;
nameStr = HeaderNames.From;
}
@@ -7369,7 +7484,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
else if (((ReadUnalignedLittleEndian_uint(ref nameStart) & 0xdfdfdfdfu) == 0x474e4152u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)4) & 0xdfu) == 0x45u))
{
- flag = 0x800000000L;
+ flag = 0x1000000000L;
values = ref _headers._Range;
nameStr = HeaderNames.Range;
}
@@ -7384,25 +7499,25 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
else if ((firstTerm6 == 0x4b4f4f43u) && ((ReadUnalignedLittleEndian_ushort(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4549u))
{
- flag = 0x20000L;
+ flag = 0x40000L;
values = ref _headers._Cookie;
nameStr = HeaderNames.Cookie;
}
else if ((firstTerm6 == 0x45505845u) && ((ReadUnalignedLittleEndian_ushort(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x5443u))
{
- flag = 0x100000L;
+ flag = 0x200000L;
values = ref _headers._Expect;
nameStr = HeaderNames.Expect;
}
else if ((firstTerm6 == 0x4749524fu) && ((ReadUnalignedLittleEndian_ushort(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4e49u))
{
- flag = 0x100000000L;
+ flag = 0x200000000L;
values = ref _headers._Origin;
nameStr = HeaderNames.Origin;
}
else if ((firstTerm6 == 0x47415250u) && ((ReadUnalignedLittleEndian_ushort(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x414du))
{
- flag = 0x200000000L;
+ flag = 0x400000000L;
values = ref _headers._Pragma;
nameStr = HeaderNames.Pragma;
}
@@ -7416,31 +7531,31 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
else if (((ReadUnalignedLittleEndian_uint(ref nameStart) & 0xdfdfdfffu) == 0x4843533au) && ((ReadUnalignedLittleEndian_ushort(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4d45u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x45u))
{
- flag = 0x80L;
+ flag = 0x100L;
values = ref _headers._Scheme;
nameStr = HeaderNames.Scheme;
}
else if (((ReadUnalignedLittleEndian_uint(ref nameStart) & 0xdfdfdfdfu) == 0x47474142u) && ((ReadUnalignedLittleEndian_ushort(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4741u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x45u))
{
- flag = 0x4000L;
+ flag = 0x8000L;
values = ref _headers._Baggage;
nameStr = HeaderNames.Baggage;
}
else if (((ReadUnalignedLittleEndian_uint(ref nameStart) & 0xdfdfdfdfu) == 0x45464552u) && ((ReadUnalignedLittleEndian_ushort(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4552u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x52u))
{
- flag = 0x1000000000L;
+ flag = 0x2000000000L;
values = ref _headers._Referer;
nameStr = HeaderNames.Referer;
}
else if (((ReadUnalignedLittleEndian_uint(ref nameStart) & 0xdfdfdfdfu) == 0x52475055u) && ((ReadUnalignedLittleEndian_ushort(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4441u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x45u))
{
- flag = 0x80000000000L;
+ flag = 0x100000000000L;
values = ref _headers._Upgrade;
nameStr = HeaderNames.Upgrade;
}
else if (((ReadUnalignedLittleEndian_uint(ref nameStart) & 0xdfdfdfdfu) == 0x4e524157u) && ((ReadUnalignedLittleEndian_ushort(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4e49u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x47u))
{
- flag = 0x400000000000L;
+ flag = 0x800000000000L;
values = ref _headers._Warning;
nameStr = HeaderNames.Warning;
}
@@ -7449,21 +7564,27 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
var firstTerm8 = (ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xdfdfdfdfdfffdfdfuL);
if ((firstTerm8 == 0x484354414d2d4649uL))
{
- flag = 0x2000000L;
+ flag = 0x4000000L;
values = ref _headers._IfMatch;
nameStr = HeaderNames.IfMatch;
}
else if ((firstTerm8 == 0x45474e41522d4649uL))
{
- flag = 0x10000000L;
+ flag = 0x20000000L;
values = ref _headers._IfRange;
nameStr = HeaderNames.IfRange;
}
break;
case 9:
- if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xdfdfdfdfdfdfdfdfuL) == 0x54414c534e415254uL) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)8) & 0xdfu) == 0x45u))
+ if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xdfdfdfdfdfdfdfffuL) == 0x4f434f544f52503auL) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)8) & 0xdfu) == 0x4cu))
{
- flag = 0x40000000000L;
+ flag = 0x80L;
+ values = ref _headers._Protocol;
+ nameStr = HeaderNames.Protocol;
+ }
+ else if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xdfdfdfdfdfdfdfdfuL) == 0x54414c534e415254uL) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)8) & 0xdfu) == 0x45u))
+ {
+ flag = 0x80000000000L;
values = ref _headers._Translate;
nameStr = HeaderNames.Translate;
}
@@ -7489,19 +7610,19 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
else if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xdfdfdfffdfdfdfdfuL) == 0x494c412d5045454buL) && ((ReadUnalignedLittleEndian_ushort(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(4 * sizeof(ushort)))) & 0xdfdfu) == 0x4556u))
{
- flag = 0x40000000L;
+ flag = 0x80000000L;
values = ref _headers._KeepAlive;
nameStr = HeaderNames.KeepAlive;
}
else if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xffdfdfdfdfdfdfdfuL) == 0x2d54534555514552uL) && ((ReadUnalignedLittleEndian_ushort(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(4 * sizeof(ushort)))) & 0xdfdfu) == 0x4449u))
{
- flag = 0x2000000000L;
+ flag = 0x4000000000L;
values = ref _headers._RequestId;
nameStr = HeaderNames.RequestId;
}
else if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xdfdfdfdfdfdfdfdfuL) == 0x4154534543415254uL) && ((ReadUnalignedLittleEndian_ushort(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(4 * sizeof(ushort)))) & 0xdfdfu) == 0x4554u))
{
- flag = 0x10000000000L;
+ flag = 0x20000000000L;
values = ref _headers._TraceState;
nameStr = HeaderNames.TraceState;
}
@@ -7509,7 +7630,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
case 11:
if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xdfdfdfdfdfdfdfdfuL) == 0x5241504543415254uL) && ((ReadUnalignedLittleEndian_ushort(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(4 * sizeof(ushort)))) & 0xdfdfu) == 0x4e45u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)10) & 0xdfu) == 0x54u))
{
- flag = 0x8000000000L;
+ flag = 0x10000000000L;
values = ref _headers._TraceParent;
nameStr = HeaderNames.TraceParent;
}
@@ -7517,19 +7638,19 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
case 12:
if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xffdfdfdfdfdfdfdfuL) == 0x2d544e45544e4f43uL) && ((ReadUnalignedLittleEndian_uint(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x45505954u))
{
- flag = 0x10000L;
+ flag = 0x20000L;
values = ref _headers._ContentType;
nameStr = HeaderNames.ContentType;
}
else if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xdfdfdfffdfdfdfdfuL) == 0x4d49542d43505247uL) && ((ReadUnalignedLittleEndian_uint(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x54554f45u))
{
- flag = 0x1000000L;
+ flag = 0x2000000L;
values = ref _headers._GrpcTimeout;
nameStr = HeaderNames.GrpcTimeout;
}
else if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xdfdfdfdfffdfdfdfuL) == 0x57524f462d58414duL) && ((ReadUnalignedLittleEndian_uint(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x53445241u))
{
- flag = 0x80000000L;
+ flag = 0x100000000L;
values = ref _headers._MaxForwards;
nameStr = HeaderNames.MaxForwards;
}
@@ -7537,25 +7658,25 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
case 13:
if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xdfdfdfdfdfdfdfdfuL) == 0x5a49524f48545541uL) && ((ReadUnalignedLittleEndian_uint(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x4f495441u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)12) & 0xdfu) == 0x4eu))
{
- flag = 0x2000L;
+ flag = 0x4000L;
values = ref _headers._Authorization;
nameStr = HeaderNames.Authorization;
}
else if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xdfdfffdfdfdfdfdfuL) == 0x4f432d4548434143uL) && ((ReadUnalignedLittleEndian_uint(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x4f52544eu) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)12) & 0xdfu) == 0x4cu))
{
- flag = 0x8000L;
+ flag = 0x10000L;
values = ref _headers._CacheControl;
nameStr = HeaderNames.CacheControl;
}
else if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xdfdfdfffdfdfdfdfuL) == 0x434e452d43505247uL) && ((ReadUnalignedLittleEndian_uint(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x4e49444fu) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)12) & 0xdfu) == 0x47u))
{
- flag = 0x800000L;
+ flag = 0x1000000L;
values = ref _headers._GrpcEncoding;
nameStr = HeaderNames.GrpcEncoding;
}
else if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xffdfdfdfdfffdfdfuL) == 0x2d454e4f4e2d4649uL) && ((ReadUnalignedLittleEndian_uint(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x4354414du) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)12) & 0xdfu) == 0x48u))
{
- flag = 0x8000000L;
+ flag = 0x10000000L;
values = ref _headers._IfNoneMatch;
nameStr = HeaderNames.IfNoneMatch;
}
@@ -7563,7 +7684,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
case 14:
if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xdfffdfdfdfdfdfdfuL) == 0x432d545045434341uL) && ((ReadUnalignedLittleEndian_uint(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x53524148u) && ((ReadUnalignedLittleEndian_ushort(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(6 * sizeof(ushort)))) & 0xdfdfu) == 0x5445u))
{
- flag = 0x100L;
+ flag = 0x200L;
values = ref _headers._AcceptCharset;
nameStr = HeaderNames.AcceptCharset;
}
@@ -7586,13 +7707,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
var firstTerm15 = (ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xdfffdfdfdfdfdfdfuL);
if ((firstTerm15 == 0x452d545045434341uL) && ((ReadUnalignedLittleEndian_uint(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x444f434eu) && ((ReadUnalignedLittleEndian_ushort(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(6 * sizeof(ushort)))) & 0xdfdfu) == 0x4e49u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)14) & 0xdfu) == 0x47u))
{
- flag = 0x200L;
+ flag = 0x400L;
values = ref _headers._AcceptEncoding;
nameStr = HeaderNames.AcceptEncoding;
}
else if ((firstTerm15 == 0x4c2d545045434341uL) && ((ReadUnalignedLittleEndian_uint(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x55474e41u) && ((ReadUnalignedLittleEndian_ushort(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(6 * sizeof(ushort)))) & 0xdfdfu) == 0x4741u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)14) & 0xdfu) == 0x45u))
{
- flag = 0x400L;
+ flag = 0x800L;
values = ref _headers._AcceptLanguage;
nameStr = HeaderNames.AcceptLanguage;
}
@@ -7600,13 +7721,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
case 17:
if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xdfdfdfdfdfffdfdfuL) == 0x4649444f4d2d4649uL) && ((ReadUnalignedLittleEndian_ulong(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfdfdfdfffdfdfdfuL) == 0x434e49532d444549uL) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)16) & 0xdfu) == 0x45u))
{
- flag = 0x4000000L;
+ flag = 0x8000000L;
values = ref _headers._IfModifiedSince;
nameStr = HeaderNames.IfModifiedSince;
}
else if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xdfdfdfdfdfdfdfdfuL) == 0x524546534e415254uL) && ((ReadUnalignedLittleEndian_ulong(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfdfdfdfdfdfdfffuL) == 0x4e49444f434e452duL) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)16) & 0xdfu) == 0x47u))
{
- flag = 0x20000000000L;
+ flag = 0x40000000000L;
values = ref _headers._TransferEncoding;
nameStr = HeaderNames.TransferEncoding;
}
@@ -7614,19 +7735,19 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
case 19:
if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xdfdfdfdfdfdfdfdfuL) == 0x54414c4552524f43uL) && ((ReadUnalignedLittleEndian_ulong(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfdfdfdfffdfdfdfuL) == 0x544e4f432d4e4f49uL) && ((ReadUnalignedLittleEndian_ushort(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(8 * sizeof(ushort)))) & 0xdfdfu) == 0x5845u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)18) & 0xdfu) == 0x54u))
{
- flag = 0x40000L;
+ flag = 0x80000L;
values = ref _headers._CorrelationContext;
nameStr = HeaderNames.CorrelationContext;
}
else if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xdfdfdfdfdfffdfdfuL) == 0x444f4d4e552d4649uL) && ((ReadUnalignedLittleEndian_ulong(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfdfffdfdfdfdfdfuL) == 0x49532d4445494649uL) && ((ReadUnalignedLittleEndian_ushort(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(8 * sizeof(ushort)))) & 0xdfdfu) == 0x434eu) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)18) & 0xdfu) == 0x45u))
{
- flag = 0x20000000L;
+ flag = 0x40000000L;
values = ref _headers._IfUnmodifiedSince;
nameStr = HeaderNames.IfUnmodifiedSince;
}
else if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xdfdfffdfdfdfdfdfuL) == 0x55412d59584f5250uL) && ((ReadUnalignedLittleEndian_ulong(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfdfdfdfdfdfdfdfuL) == 0x54415a49524f4854uL) && ((ReadUnalignedLittleEndian_ushort(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(8 * sizeof(ushort)))) & 0xdfdfu) == 0x4f49u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)18) & 0xdfu) == 0x4eu))
{
- flag = 0x400000000L;
+ flag = 0x800000000L;
values = ref _headers._ProxyAuthorization;
nameStr = HeaderNames.ProxyAuthorization;
}
@@ -7634,7 +7755,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
case 20:
if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xdfdfdfffdfdfdfdfuL) == 0x4343412d43505247uL) && ((ReadUnalignedLittleEndian_ulong(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfdfdfdfffdfdfdfuL) == 0x4f434e452d545045uL) && ((ReadUnalignedLittleEndian_uint(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(4 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x474e4944u))
{
- flag = 0x400000L;
+ flag = 0x800000L;
values = ref _headers._GrpcAcceptEncoding;
nameStr = HeaderNames.GrpcAcceptEncoding;
}
@@ -7642,7 +7763,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
case 25:
if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xffdfdfdfdfdfdfdfuL) == 0x2d45444152475055uL) && ((ReadUnalignedLittleEndian_ulong(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfdfdfdfdfdfdfdfuL) == 0x4552554345534e49uL) && ((ReadUnalignedLittleEndian_ulong(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ulong)))) & 0xdfdfdfdfdfdfdfffuL) == 0x545345555145522duL) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)24) & 0xdfu) == 0x53u))
{
- flag = 0x100000000000L;
+ flag = 0x200000000000L;
values = ref _headers._UpgradeInsecureRequests;
nameStr = HeaderNames.UpgradeInsecureRequests;
}
@@ -7650,7 +7771,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
case 29:
if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xdfffdfdfdfdfdfdfuL) == 0x432d535345434341uL) && ((ReadUnalignedLittleEndian_ulong(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfffdfdfdfdfdfdfuL) == 0x522d4c4f52544e4fuL) && ((ReadUnalignedLittleEndian_ulong(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ulong)))) & 0xdfffdfdfdfdfdfdfuL) == 0x4d2d545345555145uL) && ((ReadUnalignedLittleEndian_uint(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(6 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x4f485445u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)28) & 0xdfu) == 0x44u))
{
- flag = 0x1000L;
+ flag = 0x2000L;
values = ref _headers._AccessControlRequestMethod;
nameStr = HeaderNames.AccessControlRequestMethod;
}
@@ -7658,7 +7779,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
case 30:
if (((ReadUnalignedLittleEndian_ulong(ref nameStart) & 0xdfffdfdfdfdfdfdfuL) == 0x432d535345434341uL) && ((ReadUnalignedLittleEndian_ulong(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfffdfdfdfdfdfdfuL) == 0x522d4c4f52544e4fuL) && ((ReadUnalignedLittleEndian_ulong(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ulong)))) & 0xdfffdfdfdfdfdfdfuL) == 0x482d545345555145uL) && ((ReadUnalignedLittleEndian_uint(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(6 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x45444145u) && ((ReadUnalignedLittleEndian_ushort(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(14 * sizeof(ushort)))) & 0xdfdfu) == 0x5352u))
{
- flag = 0x800L;
+ flag = 0x1000L;
values = ref _headers._AccessControlRequestHeaders;
nameStr = HeaderNames.AccessControlRequestHeaders;
}
@@ -7743,22 +7864,22 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
break;
case 6:
case 7:
- flag = 0x80L;
+ flag = 0x100L;
values = ref _headers._Scheme;
nameStr = HeaderNames.Scheme;
break;
case 15:
- flag = 0x100L;
+ flag = 0x200L;
values = ref _headers._AcceptCharset;
nameStr = HeaderNames.AcceptCharset;
break;
case 16:
- flag = 0x200L;
+ flag = 0x400L;
values = ref _headers._AcceptEncoding;
nameStr = HeaderNames.AcceptEncoding;
break;
case 17:
- flag = 0x400L;
+ flag = 0x800L;
values = ref _headers._AcceptLanguage;
nameStr = HeaderNames.AcceptLanguage;
break;
@@ -7768,12 +7889,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
nameStr = HeaderNames.Accept;
break;
case 23:
- flag = 0x2000L;
+ flag = 0x4000L;
values = ref _headers._Authorization;
nameStr = HeaderNames.Authorization;
break;
case 24:
- flag = 0x8000L;
+ flag = 0x10000L;
values = ref _headers._CacheControl;
nameStr = HeaderNames.CacheControl;
break;
@@ -7790,27 +7911,27 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
return true;
case 31:
- flag = 0x10000L;
+ flag = 0x20000L;
values = ref _headers._ContentType;
nameStr = HeaderNames.ContentType;
break;
case 32:
- flag = 0x20000L;
+ flag = 0x40000L;
values = ref _headers._Cookie;
nameStr = HeaderNames.Cookie;
break;
case 33:
- flag = 0x80000L;
+ flag = 0x100000L;
values = ref _headers._Date;
nameStr = HeaderNames.Date;
break;
case 35:
- flag = 0x100000L;
+ flag = 0x200000L;
values = ref _headers._Expect;
nameStr = HeaderNames.Expect;
break;
case 37:
- flag = 0x200000L;
+ flag = 0x400000L;
values = ref _headers._From;
nameStr = HeaderNames.From;
break;
@@ -7820,52 +7941,52 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
nameStr = HeaderNames.Host;
break;
case 39:
- flag = 0x2000000L;
+ flag = 0x4000000L;
values = ref _headers._IfMatch;
nameStr = HeaderNames.IfMatch;
break;
case 40:
- flag = 0x4000000L;
+ flag = 0x8000000L;
values = ref _headers._IfModifiedSince;
nameStr = HeaderNames.IfModifiedSince;
break;
case 41:
- flag = 0x8000000L;
+ flag = 0x10000000L;
values = ref _headers._IfNoneMatch;
nameStr = HeaderNames.IfNoneMatch;
break;
case 42:
- flag = 0x10000000L;
+ flag = 0x20000000L;
values = ref _headers._IfRange;
nameStr = HeaderNames.IfRange;
break;
case 43:
- flag = 0x20000000L;
+ flag = 0x40000000L;
values = ref _headers._IfUnmodifiedSince;
nameStr = HeaderNames.IfUnmodifiedSince;
break;
case 47:
- flag = 0x80000000L;
+ flag = 0x100000000L;
values = ref _headers._MaxForwards;
nameStr = HeaderNames.MaxForwards;
break;
case 49:
- flag = 0x400000000L;
+ flag = 0x800000000L;
values = ref _headers._ProxyAuthorization;
nameStr = HeaderNames.ProxyAuthorization;
break;
case 50:
- flag = 0x800000000L;
+ flag = 0x1000000000L;
values = ref _headers._Range;
nameStr = HeaderNames.Range;
break;
case 51:
- flag = 0x1000000000L;
+ flag = 0x2000000000L;
values = ref _headers._Referer;
nameStr = HeaderNames.Referer;
break;
case 57:
- flag = 0x20000000000L;
+ flag = 0x40000000000L;
values = ref _headers._TransferEncoding;
nameStr = HeaderNames.TransferEncoding;
break;
@@ -7875,7 +7996,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
nameStr = HeaderNames.UserAgent;
break;
case 60:
- flag = 0x200000000000L;
+ flag = 0x400000000000L;
values = ref _headers._Via;
nameStr = HeaderNames.Via;
break;
@@ -7959,27 +8080,27 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
return true;
case 5:
- flag = 0x20000L;
+ flag = 0x40000L;
values = ref _headers._Cookie;
nameStr = HeaderNames.Cookie;
break;
case 6:
- flag = 0x80000L;
+ flag = 0x100000L;
values = ref _headers._Date;
nameStr = HeaderNames.Date;
break;
case 8:
- flag = 0x4000000L;
+ flag = 0x8000000L;
values = ref _headers._IfModifiedSince;
nameStr = HeaderNames.IfModifiedSince;
break;
case 9:
- flag = 0x8000000L;
+ flag = 0x10000000L;
values = ref _headers._IfNoneMatch;
nameStr = HeaderNames.IfNoneMatch;
break;
case 13:
- flag = 0x1000000000L;
+ flag = 0x2000000000L;
values = ref _headers._Referer;
nameStr = HeaderNames.Referer;
break;
@@ -7996,7 +8117,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
break;
case 22:
case 23:
- flag = 0x80L;
+ flag = 0x100L;
values = ref _headers._Scheme;
nameStr = HeaderNames.Scheme;
break;
@@ -8007,7 +8128,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
nameStr = HeaderNames.Accept;
break;
case 31:
- flag = 0x200L;
+ flag = 0x400L;
values = ref _headers._AcceptEncoding;
nameStr = HeaderNames.AcceptEncoding;
break;
@@ -8017,7 +8138,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
case 39:
case 40:
case 41:
- flag = 0x8000L;
+ flag = 0x10000L;
values = ref _headers._CacheControl;
nameStr = HeaderNames.CacheControl;
break;
@@ -8032,48 +8153,48 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
case 52:
case 53:
case 54:
- flag = 0x10000L;
+ flag = 0x20000L;
values = ref _headers._ContentType;
nameStr = HeaderNames.ContentType;
break;
case 55:
- flag = 0x800000000L;
+ flag = 0x1000000000L;
values = ref _headers._Range;
nameStr = HeaderNames.Range;
break;
case 72:
- flag = 0x400L;
+ flag = 0x800L;
values = ref _headers._AcceptLanguage;
nameStr = HeaderNames.AcceptLanguage;
break;
case 80:
- flag = 0x800L;
+ flag = 0x1000L;
values = ref _headers._AccessControlRequestHeaders;
nameStr = HeaderNames.AccessControlRequestHeaders;
break;
case 81:
case 82:
- flag = 0x1000L;
+ flag = 0x2000L;
values = ref _headers._AccessControlRequestMethod;
nameStr = HeaderNames.AccessControlRequestMethod;
break;
case 84:
- flag = 0x2000L;
+ flag = 0x4000L;
values = ref _headers._Authorization;
nameStr = HeaderNames.Authorization;
break;
case 89:
- flag = 0x10000000L;
+ flag = 0x20000000L;
values = ref _headers._IfRange;
nameStr = HeaderNames.IfRange;
break;
case 90:
- flag = 0x100000000L;
+ flag = 0x200000000L;
values = ref _headers._Origin;
nameStr = HeaderNames.Origin;
break;
case 94:
- flag = 0x100000000000L;
+ flag = 0x200000000000L;
values = ref _headers._UpgradeInsecureRequests;
nameStr = HeaderNames.UpgradeInsecureRequests;
break;
@@ -8138,6 +8259,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
public StringValues _Authority;
public StringValues _Method;
public StringValues _Path;
+ public StringValues _Protocol;
public StringValues _Scheme;
public StringValues _AcceptCharset;
public StringValues _AcceptEncoding;
@@ -8223,207 +8345,212 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
_current = new KeyValuePair<string, StringValues>(HeaderNames.Path, _collection._headers._Path);
_currentBits ^= 0x40L;
break;
- case 7: // Header: ":scheme"
+ case 7: // Header: ":protocol"
Debug.Assert((_currentBits & 0x80L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.Scheme, _collection._headers._Scheme);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.Protocol, _collection._headers._Protocol);
_currentBits ^= 0x80L;
break;
- case 8: // Header: "Accept-Charset"
+ case 8: // Header: ":scheme"
Debug.Assert((_currentBits & 0x100L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.AcceptCharset, _collection._headers._AcceptCharset);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.Scheme, _collection._headers._Scheme);
_currentBits ^= 0x100L;
break;
- case 9: // Header: "Accept-Encoding"
+ case 9: // Header: "Accept-Charset"
Debug.Assert((_currentBits & 0x200L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.AcceptEncoding, _collection._headers._AcceptEncoding);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.AcceptCharset, _collection._headers._AcceptCharset);
_currentBits ^= 0x200L;
break;
- case 10: // Header: "Accept-Language"
+ case 10: // Header: "Accept-Encoding"
Debug.Assert((_currentBits & 0x400L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.AcceptLanguage, _collection._headers._AcceptLanguage);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.AcceptEncoding, _collection._headers._AcceptEncoding);
_currentBits ^= 0x400L;
break;
- case 11: // Header: "Access-Control-Request-Headers"
+ case 11: // Header: "Accept-Language"
Debug.Assert((_currentBits & 0x800L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.AccessControlRequestHeaders, _collection._headers._AccessControlRequestHeaders);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.AcceptLanguage, _collection._headers._AcceptLanguage);
_currentBits ^= 0x800L;
break;
- case 12: // Header: "Access-Control-Request-Method"
+ case 12: // Header: "Access-Control-Request-Headers"
Debug.Assert((_currentBits & 0x1000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.AccessControlRequestMethod, _collection._headers._AccessControlRequestMethod);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.AccessControlRequestHeaders, _collection._headers._AccessControlRequestHeaders);
_currentBits ^= 0x1000L;
break;
- case 13: // Header: "Authorization"
+ case 13: // Header: "Access-Control-Request-Method"
Debug.Assert((_currentBits & 0x2000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.Authorization, _collection._headers._Authorization);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.AccessControlRequestMethod, _collection._headers._AccessControlRequestMethod);
_currentBits ^= 0x2000L;
break;
- case 14: // Header: "baggage"
+ case 14: // Header: "Authorization"
Debug.Assert((_currentBits & 0x4000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.Baggage, _collection._headers._Baggage);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.Authorization, _collection._headers._Authorization);
_currentBits ^= 0x4000L;
break;
- case 15: // Header: "Cache-Control"
+ case 15: // Header: "baggage"
Debug.Assert((_currentBits & 0x8000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.CacheControl, _collection._headers._CacheControl);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.Baggage, _collection._headers._Baggage);
_currentBits ^= 0x8000L;
break;
- case 16: // Header: "Content-Type"
+ case 16: // Header: "Cache-Control"
Debug.Assert((_currentBits & 0x10000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.ContentType, _collection._headers._ContentType);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.CacheControl, _collection._headers._CacheControl);
_currentBits ^= 0x10000L;
break;
- case 17: // Header: "Cookie"
+ case 17: // Header: "Content-Type"
Debug.Assert((_currentBits & 0x20000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.Cookie, _collection._headers._Cookie);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.ContentType, _collection._headers._ContentType);
_currentBits ^= 0x20000L;
break;
- case 18: // Header: "Correlation-Context"
+ case 18: // Header: "Cookie"
Debug.Assert((_currentBits & 0x40000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.CorrelationContext, _collection._headers._CorrelationContext);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.Cookie, _collection._headers._Cookie);
_currentBits ^= 0x40000L;
break;
- case 19: // Header: "Date"
+ case 19: // Header: "Correlation-Context"
Debug.Assert((_currentBits & 0x80000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.Date, _collection._headers._Date);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.CorrelationContext, _collection._headers._CorrelationContext);
_currentBits ^= 0x80000L;
break;
- case 20: // Header: "Expect"
+ case 20: // Header: "Date"
Debug.Assert((_currentBits & 0x100000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.Expect, _collection._headers._Expect);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.Date, _collection._headers._Date);
_currentBits ^= 0x100000L;
break;
- case 21: // Header: "From"
+ case 21: // Header: "Expect"
Debug.Assert((_currentBits & 0x200000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.From, _collection._headers._From);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.Expect, _collection._headers._Expect);
_currentBits ^= 0x200000L;
break;
- case 22: // Header: "Grpc-Accept-Encoding"
+ case 22: // Header: "From"
Debug.Assert((_currentBits & 0x400000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.GrpcAcceptEncoding, _collection._headers._GrpcAcceptEncoding);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.From, _collection._headers._From);
_currentBits ^= 0x400000L;
break;
- case 23: // Header: "Grpc-Encoding"
+ case 23: // Header: "Grpc-Accept-Encoding"
Debug.Assert((_currentBits & 0x800000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.GrpcEncoding, _collection._headers._GrpcEncoding);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.GrpcAcceptEncoding, _collection._headers._GrpcAcceptEncoding);
_currentBits ^= 0x800000L;
break;
- case 24: // Header: "Grpc-Timeout"
+ case 24: // Header: "Grpc-Encoding"
Debug.Assert((_currentBits & 0x1000000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.GrpcTimeout, _collection._headers._GrpcTimeout);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.GrpcEncoding, _collection._headers._GrpcEncoding);
_currentBits ^= 0x1000000L;
break;
- case 25: // Header: "If-Match"
+ case 25: // Header: "Grpc-Timeout"
Debug.Assert((_currentBits & 0x2000000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.IfMatch, _collection._headers._IfMatch);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.GrpcTimeout, _collection._headers._GrpcTimeout);
_currentBits ^= 0x2000000L;
break;
- case 26: // Header: "If-Modified-Since"
+ case 26: // Header: "If-Match"
Debug.Assert((_currentBits & 0x4000000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.IfModifiedSince, _collection._headers._IfModifiedSince);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.IfMatch, _collection._headers._IfMatch);
_currentBits ^= 0x4000000L;
break;
- case 27: // Header: "If-None-Match"
+ case 27: // Header: "If-Modified-Since"
Debug.Assert((_currentBits & 0x8000000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.IfNoneMatch, _collection._headers._IfNoneMatch);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.IfModifiedSince, _collection._headers._IfModifiedSince);
_currentBits ^= 0x8000000L;
break;
- case 28: // Header: "If-Range"
+ case 28: // Header: "If-None-Match"
Debug.Assert((_currentBits & 0x10000000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.IfRange, _collection._headers._IfRange);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.IfNoneMatch, _collection._headers._IfNoneMatch);
_currentBits ^= 0x10000000L;
break;
- case 29: // Header: "If-Unmodified-Since"
+ case 29: // Header: "If-Range"
Debug.Assert((_currentBits & 0x20000000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.IfUnmodifiedSince, _collection._headers._IfUnmodifiedSince);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.IfRange, _collection._headers._IfRange);
_currentBits ^= 0x20000000L;
break;
- case 30: // Header: "Keep-Alive"
+ case 30: // Header: "If-Unmodified-Since"
Debug.Assert((_currentBits & 0x40000000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.KeepAlive, _collection._headers._KeepAlive);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.IfUnmodifiedSince, _collection._headers._IfUnmodifiedSince);
_currentBits ^= 0x40000000L;
break;
- case 31: // Header: "Max-Forwards"
+ case 31: // Header: "Keep-Alive"
Debug.Assert((_currentBits & 0x80000000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.MaxForwards, _collection._headers._MaxForwards);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.KeepAlive, _collection._headers._KeepAlive);
_currentBits ^= 0x80000000L;
break;
- case 32: // Header: "Origin"
+ case 32: // Header: "Max-Forwards"
Debug.Assert((_currentBits & 0x100000000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.Origin, _collection._headers._Origin);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.MaxForwards, _collection._headers._MaxForwards);
_currentBits ^= 0x100000000L;
break;
- case 33: // Header: "Pragma"
+ case 33: // Header: "Origin"
Debug.Assert((_currentBits & 0x200000000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.Pragma, _collection._headers._Pragma);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.Origin, _collection._headers._Origin);
_currentBits ^= 0x200000000L;
break;
- case 34: // Header: "Proxy-Authorization"
+ case 34: // Header: "Pragma"
Debug.Assert((_currentBits & 0x400000000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.ProxyAuthorization, _collection._headers._ProxyAuthorization);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.Pragma, _collection._headers._Pragma);
_currentBits ^= 0x400000000L;
break;
- case 35: // Header: "Range"
+ case 35: // Header: "Proxy-Authorization"
Debug.Assert((_currentBits & 0x800000000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.Range, _collection._headers._Range);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.ProxyAuthorization, _collection._headers._ProxyAuthorization);
_currentBits ^= 0x800000000L;
break;
- case 36: // Header: "Referer"
+ case 36: // Header: "Range"
Debug.Assert((_currentBits & 0x1000000000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.Referer, _collection._headers._Referer);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.Range, _collection._headers._Range);
_currentBits ^= 0x1000000000L;
break;
- case 37: // Header: "Request-Id"
+ case 37: // Header: "Referer"
Debug.Assert((_currentBits & 0x2000000000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.RequestId, _collection._headers._RequestId);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.Referer, _collection._headers._Referer);
_currentBits ^= 0x2000000000L;
break;
- case 38: // Header: "TE"
+ case 38: // Header: "Request-Id"
Debug.Assert((_currentBits & 0x4000000000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.TE, _collection._headers._TE);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.RequestId, _collection._headers._RequestId);
_currentBits ^= 0x4000000000L;
break;
- case 39: // Header: "traceparent"
+ case 39: // Header: "TE"
Debug.Assert((_currentBits & 0x8000000000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.TraceParent, _collection._headers._TraceParent);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.TE, _collection._headers._TE);
_currentBits ^= 0x8000000000L;
break;
- case 40: // Header: "tracestate"
+ case 40: // Header: "traceparent"
Debug.Assert((_currentBits & 0x10000000000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.TraceState, _collection._headers._TraceState);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.TraceParent, _collection._headers._TraceParent);
_currentBits ^= 0x10000000000L;
break;
- case 41: // Header: "Transfer-Encoding"
+ case 41: // Header: "tracestate"
Debug.Assert((_currentBits & 0x20000000000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.TransferEncoding, _collection._headers._TransferEncoding);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.TraceState, _collection._headers._TraceState);
_currentBits ^= 0x20000000000L;
break;
- case 42: // Header: "Translate"
+ case 42: // Header: "Transfer-Encoding"
Debug.Assert((_currentBits & 0x40000000000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.Translate, _collection._headers._Translate);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.TransferEncoding, _collection._headers._TransferEncoding);
_currentBits ^= 0x40000000000L;
break;
- case 43: // Header: "Upgrade"
+ case 43: // Header: "Translate"
Debug.Assert((_currentBits & 0x80000000000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.Upgrade, _collection._headers._Upgrade);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.Translate, _collection._headers._Translate);
_currentBits ^= 0x80000000000L;
break;
- case 44: // Header: "Upgrade-Insecure-Requests"
+ case 44: // Header: "Upgrade"
Debug.Assert((_currentBits & 0x100000000000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.UpgradeInsecureRequests, _collection._headers._UpgradeInsecureRequests);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.Upgrade, _collection._headers._Upgrade);
_currentBits ^= 0x100000000000L;
break;
- case 45: // Header: "Via"
+ case 45: // Header: "Upgrade-Insecure-Requests"
Debug.Assert((_currentBits & 0x200000000000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.Via, _collection._headers._Via);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.UpgradeInsecureRequests, _collection._headers._UpgradeInsecureRequests);
_currentBits ^= 0x200000000000L;
break;
- case 46: // Header: "Warning"
+ case 46: // Header: "Via"
Debug.Assert((_currentBits & 0x400000000000L) != 0);
- _current = new KeyValuePair<string, StringValues>(HeaderNames.Warning, _collection._headers._Warning);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.Via, _collection._headers._Via);
_currentBits ^= 0x400000000000L;
break;
- case 47: // Header: "Content-Length"
+ case 47: // Header: "Warning"
+ Debug.Assert((_currentBits & 0x800000000000L) != 0);
+ _current = new KeyValuePair<string, StringValues>(HeaderNames.Warning, _collection._headers._Warning);
+ _currentBits ^= 0x800000000000L;
+ break;
+ case 48: // Header: "Content-Length"
Debug.Assert(_currentBits == 0);
_current = new KeyValuePair<string, StringValues>(HeaderNames.ContentLength, HeaderUtilities.FormatNonNegativeInt64(_collection._contentLength.GetValueOrDefault()));
_next = -1;
@@ -8445,7 +8572,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
else
{
- _next = _collection._contentLength.HasValue ? 47 : -1;
+ _next = _collection._contentLength.HasValue ? 48 : -1;
return true;
}
}
diff --git a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Connection.cs b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Connection.cs
index 13122abe2d..8303447f01 100644
--- a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Connection.cs
+++ b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Connection.cs
@@ -56,6 +56,10 @@ internal sealed class Http3Connection : IHttp3StreamLifetimeHandler, IRequestPro
_serverSettings.HeaderTableSize = (uint)httpLimits.Http3.HeaderTableSize;
_serverSettings.MaxRequestHeaderFieldSectionSize = (uint)httpLimits.MaxRequestHeadersTotalSize;
+ _serverSettings.EnableWebTransport = Convert.ToUInt32(context.ServiceContext.ServerOptions.EnableWebTransportAndH3Datagrams);
+ // technically these are 2 different settings so they should have separate values but the Chromium implementation requires
+ // them to both be 1 to useWebTransport.
+ _serverSettings.H3Datagram = Convert.ToUInt32(context.ServiceContext.ServerOptions.EnableWebTransportAndH3Datagrams);
}
private void UpdateHighestOpenedRequestStreamId(long streamId)
@@ -656,6 +660,12 @@ internal sealed class Http3Connection : IHttp3StreamLifetimeHandler, IRequestPro
break;
case Http3SettingType.QPackBlockedStreams:
break;
+ case Http3SettingType.EnableWebTransport:
+ _clientSettings.EnableWebTransport = (uint)value;
+ break;
+ case Http3SettingType.H3Datagram:
+ _clientSettings.H3Datagram = (uint)value;
+ break;
default:
throw new InvalidOperationException("Unexpected setting: " + type);
}
diff --git a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3ControlStream.cs b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3ControlStream.cs
index e709d5486d..e9115e5282 100644
--- a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3ControlStream.cs
+++ b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3ControlStream.cs
@@ -331,6 +331,8 @@ internal abstract class Http3ControlStream : IHttp3Stream, IThreadPoolWorkItem
case (long)Http3SettingType.QPackMaxTableCapacity:
case (long)Http3SettingType.MaxFieldSectionSize:
case (long)Http3SettingType.QPackBlockedStreams:
+ case (long)Http3SettingType.EnableWebTransport:
+ case (long)Http3SettingType.H3Datagram:
_context.StreamLifetimeHandler.OnInboundControlStreamSetting((Http3SettingType)id, value);
break;
default:
diff --git a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3PeerSettings.cs b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3PeerSettings.cs
index 177ec30216..144e9dc1de 100644
--- a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3PeerSettings.cs
+++ b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3PeerSettings.cs
@@ -8,9 +8,13 @@ internal sealed class Http3PeerSettings
// Note these are protocol defaults, not Kestrel defaults.
public const uint DefaultHeaderTableSize = 0;
public const uint DefaultMaxRequestHeaderFieldSize = uint.MaxValue;
+ public const uint DefaultEnableWebTransport = 0;
+ public const uint DefaultH3Datagram = 0;
public uint HeaderTableSize { get; internal set; } = DefaultHeaderTableSize;
public uint MaxRequestHeaderFieldSectionSize { get; internal set; } = DefaultMaxRequestHeaderFieldSize;
+ public uint EnableWebTransport { get; internal set; } = DefaultEnableWebTransport;
+ public uint H3Datagram { get; internal set; } = DefaultH3Datagram;
// Gets the settings that are different from the protocol defaults (as opposed to the server defaults).
internal List<Http3PeerSetting> GetNonProtocolDefaults()
@@ -29,6 +33,16 @@ internal sealed class Http3PeerSettings
list.Add(new Http3PeerSetting(Http3SettingType.MaxFieldSectionSize, MaxRequestHeaderFieldSectionSize));
}
+ if (EnableWebTransport != DefaultEnableWebTransport)
+ {
+ list.Add(new Http3PeerSetting(Http3SettingType.EnableWebTransport, EnableWebTransport));
+ }
+
+ if (H3Datagram != DefaultH3Datagram)
+ {
+ list.Add(new Http3PeerSetting(Http3SettingType.H3Datagram, H3Datagram));
+ }
+
return list;
}
}
diff --git a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3SettingType.cs b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3SettingType.cs
index 2d12fd96eb..4e79e025bd 100644
--- a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3SettingType.cs
+++ b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3SettingType.cs
@@ -13,5 +13,18 @@ internal enum Http3SettingType : long
/// </summary>
MaxFieldSectionSize = 0x6,
// https://quicwg.org/base-drafts/draft-ietf-quic-qpack.html#section-5
- QPackBlockedStreams = 0x7
+ QPackBlockedStreams = 0x7,
+
+ /// <summary>
+ /// SETTINGS_ENABLE_WEBTRANSPORT, default is 0 (off)
+ /// https://www.ietf.org/archive/id/draft-ietf-webtrans-http3-01.html#name-http-3-settings-parameter-r
+ /// </summary>
+ EnableWebTransport = 0x2b603742,
+
+ /// <summary>
+ /// H3_DATAGRAM, default is 0 (off)
+ /// indicates that the server suppprts sending individual datagrams over Http/3
+ /// rather than just streams.
+ /// </summary>
+ H3Datagram = 0xffd277
}
diff --git a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Stream.cs b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Stream.cs
index 503e4120b0..fd264c564a 100644
--- a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Stream.cs
+++ b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Stream.cs
@@ -29,6 +29,7 @@ internal abstract partial class Http3Stream : HttpProtocol, IHttp3Stream, IHttpS
private static ReadOnlySpan<byte> AuthorityBytes => ":authority"u8;
private static ReadOnlySpan<byte> MethodBytes => ":method"u8;
private static ReadOnlySpan<byte> PathBytes => ":path"u8;
+ private static ReadOnlySpan<byte> ProtocolBytes => ":protocol"u8;
private static ReadOnlySpan<byte> SchemeBytes => ":scheme"u8;
private static ReadOnlySpan<byte> StatusBytes => ":status"u8;
private static ReadOnlySpan<byte> ConnectionBytes => "connection"u8;
@@ -507,6 +508,10 @@ internal abstract partial class Http3Stream : HttpProtocol, IHttp3Stream, IHttpS
{
return PseudoHeaderFields.Authority;
}
+ else if (name.SequenceEqual(ProtocolBytes))
+ {
+ return PseudoHeaderFields.Protocol;
+ }
else
{
return PseudoHeaderFields.Unknown;
@@ -821,7 +826,25 @@ internal abstract partial class Http3Stream : HttpProtocol, IHttp3Stream, IHttpS
await OnEndStreamReceived();
}
- if (!_isMethodConnect && (_parsedPseudoHeaderFields & _mandatoryRequestPseudoHeaderFields) != _mandatoryRequestPseudoHeaderFields)
+ // https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3/#section-3.3
+ if (_context.ServiceContext.ServerOptions.EnableWebTransportAndH3Datagrams && HttpRequestHeaders.HeaderProtocol.Count > 0)
+ {
+ if (!_isMethodConnect)
+ {
+ throw new Http3StreamErrorException(CoreStrings.Http3MethodMustBeConnectWhenUsingProtocolPseudoHeader, Http3ErrorCode.ProtocolError);
+ }
+
+ if (!_parsedPseudoHeaderFields.HasFlag(PseudoHeaderFields.Authority) || !_parsedPseudoHeaderFields.HasFlag(PseudoHeaderFields.Path))
+ {
+ throw new Http3StreamErrorException(CoreStrings.Http3MissingAuthorityOrPathPseudoHeaders, Http3ErrorCode.ProtocolError);
+ }
+
+ if (_context.ClientPeerSettings.H3Datagram != _context.ServerPeerSettings.H3Datagram)
+ {
+ throw new Http3StreamErrorException(CoreStrings.FormatHttp3DatagramStatusMismatch(_context.ClientPeerSettings.H3Datagram == 1, _context.ServerPeerSettings.H3Datagram == 1), Http3ErrorCode.SettingsError);
+ }
+ }
+ else if (!_isMethodConnect && (_parsedPseudoHeaderFields & _mandatoryRequestPseudoHeaderFields) != _mandatoryRequestPseudoHeaderFields)
{
// All HTTP/3 requests MUST include exactly one valid value for the :method, :scheme, and :path pseudo-header
// fields, unless it is a CONNECT request. An HTTP request that omits mandatory pseudo-header
@@ -928,8 +951,8 @@ internal abstract partial class Http3Stream : HttpProtocol, IHttp3Stream, IHttpS
return false;
}
- // CONNECT - :scheme and :path must be excluded
- if (Method == Http.HttpMethod.Connect)
+ // CONNECT - :scheme and :path must be excluded=
+ if (Method == Http.HttpMethod.Connect && HttpRequestHeaders.HeaderProtocol.Count == 0)
{
if (!string.IsNullOrEmpty(RequestHeaders[HeaderNames.Scheme]) || !string.IsNullOrEmpty(RequestHeaders[HeaderNames.Path]))
{
@@ -1157,6 +1180,7 @@ internal abstract partial class Http3Stream : HttpProtocol, IHttp3Stream, IHttpS
Path = 0x4,
Scheme = 0x8,
Status = 0x10,
+ Protocol = 0x20,
Unknown = 0x40000000
}
diff --git a/src/Servers/Kestrel/Core/src/KestrelServerOptions.cs b/src/Servers/Kestrel/Core/src/KestrelServerOptions.cs
index ec009ae0df..4575b3e77c 100644
--- a/src/Servers/Kestrel/Core/src/KestrelServerOptions.cs
+++ b/src/Servers/Kestrel/Core/src/KestrelServerOptions.cs
@@ -158,6 +158,24 @@ public class KestrelServerOptions
internal bool IsDevCertLoaded { get; set; }
/// <summary>
+ /// Internal AppContext switch to toggle the WebTransport and HTTP/3 datagrams experiemental features.
+ /// </summary>
+ private bool? _enableWebTransportAndH3Datagrams;
+ internal bool EnableWebTransportAndH3Datagrams
+ {
+ get
+ {
+ if (!_enableWebTransportAndH3Datagrams.HasValue)
+ {
+ _enableWebTransportAndH3Datagrams = AppContext.TryGetSwitch("Microsoft.AspNetCore.Server.Kestrel.Experimental.WebTransportAndH3Datagrams", out var enabled) && enabled;
+ }
+
+ return _enableWebTransportAndH3Datagrams.Value;
+ }
+ set => _enableWebTransportAndH3Datagrams = value;
+ }
+
+ /// <summary>
/// Specifies a configuration Action to run for each newly created endpoint. Calling this again will replace
/// the prior action.
/// </summary>
diff --git a/src/Servers/Kestrel/samples/Http3SampleApp/Http3SampleApp.csproj b/src/Servers/Kestrel/samples/Http3SampleApp/Http3SampleApp.csproj
index c56f7fb391..e65103ddb5 100644
--- a/src/Servers/Kestrel/samples/Http3SampleApp/Http3SampleApp.csproj
+++ b/src/Servers/Kestrel/samples/Http3SampleApp/Http3SampleApp.csproj
@@ -16,4 +16,9 @@
<Reference Include="Microsoft.Extensions.Hosting" />
<Reference Include="Microsoft.AspNetCore.Server.Kestrel.Transport.Quic" />
</ItemGroup>
+
+ <ItemGroup>
+ <!-- Turn on the WebTransport AppContext switch -->
+ <RuntimeHostConfigurationOption Include="Microsoft.AspNetCore.Server.Kestrel.Experimental.WebTransportAndH3Datagrams" Value="true" />
+ </ItemGroup>
</Project>
diff --git a/src/Servers/Kestrel/samples/Http3SampleApp/Program.cs b/src/Servers/Kestrel/samples/Http3SampleApp/Program.cs
index 22a9d27911..c65b05bec0 100644
--- a/src/Servers/Kestrel/samples/Http3SampleApp/Program.cs
+++ b/src/Servers/Kestrel/samples/Http3SampleApp/Program.cs
@@ -1,7 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.Net;
using System.Net.Security;
+using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using Microsoft.AspNetCore.Connections;
using Microsoft.AspNetCore.Internal;
@@ -22,25 +24,18 @@ public class Program
})
.ConfigureWebHost(webHost =>
{
+ var cert = CertificateLoader.LoadFromStoreCert("localhost", StoreName.My.ToString(), StoreLocation.CurrentUser, false);
+
webHost.UseKestrel()
.ConfigureKestrel((context, options) =>
{
- var cert = CertificateLoader.LoadFromStoreCert("localhost", StoreName.My.ToString(), StoreLocation.CurrentUser, false);
-
- options.ConfigureHttpsDefaults(httpsOptions =>
- {
- httpsOptions.ServerCertificate = cert;
- // httpsOptions.ClientCertificateMode = ClientCertificateMode.AllowCertificate;
- // httpsOptions.AllowAnyClientCertificate();
- });
-
options.ListenAnyIP(5000, listenOptions =>
{
listenOptions.UseConnectionLogging();
listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
});
- options.ListenAnyIP(5001, listenOptions =>
+ options.Listen(IPAddress.Any, 5001, listenOptions =>
{
listenOptions.UseHttps();
listenOptions.UseConnectionLogging();
@@ -49,8 +44,8 @@ public class Program
options.ListenAnyIP(5002, listenOptions =>
{
- listenOptions.UseHttps(StoreName.My, "localhost");
listenOptions.UseConnectionLogging();
+ listenOptions.UseHttps(StoreName.My, "localhost");
listenOptions.Protocols = HttpProtocols.Http3;
});
@@ -108,6 +103,14 @@ public class Program
listenOptions.UseConnectionLogging();
listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
});
+
+ // Port configured for WebTransport
+ options.Listen(IPAddress.Any, 5007, listenOptions =>
+ {
+ listenOptions.UseHttps(GenerateManualCertificate());
+ listenOptions.UseConnectionLogging();
+ listenOptions.Protocols = HttpProtocols.Http1AndHttp2AndHttp3;
+ });
})
.UseStartup<Startup>();
});
@@ -119,4 +122,54 @@ public class Program
host.Run();
}
+
+ // Adapted from: https://github.com/wegylexy/webtransport
+ // We will need to eventually merge this with existing Kestrel certificate generation
+ // tracked in issue #41762
+ private static X509Certificate2 GenerateManualCertificate()
+ {
+ X509Certificate2 cert = null;
+ var store = new X509Store("KestrelWebTransportCertificates", StoreLocation.CurrentUser);
+ store.Open(OpenFlags.ReadWrite);
+ if (store.Certificates.Count > 0)
+ {
+ cert = store.Certificates[^1];
+
+ // rotate key after it expires
+ if (DateTime.Parse(cert.GetExpirationDateString(), null) < DateTimeOffset.UtcNow)
+ {
+ cert = null;
+ }
+ }
+ if (cert == null)
+ {
+ // generate a new cert
+ var now = DateTimeOffset.UtcNow;
+ SubjectAlternativeNameBuilder sanBuilder = new();
+ sanBuilder.AddDnsName("localhost");
+ using var ec = ECDsa.Create(ECCurve.NamedCurves.nistP256);
+ CertificateRequest req = new("CN=localhost", ec, HashAlgorithmName.SHA256);
+ // Adds purpose
+ req.CertificateExtensions.Add(new X509EnhancedKeyUsageExtension(new OidCollection
+ {
+ new("1.3.6.1.5.5.7.3.1") // serverAuth
+ }, false));
+ // Adds usage
+ req.CertificateExtensions.Add(new X509KeyUsageExtension(X509KeyUsageFlags.DigitalSignature, false));
+ // Adds subject alternate names
+ req.CertificateExtensions.Add(sanBuilder.Build());
+ // Sign
+ using var crt = req.CreateSelfSigned(now, now.AddDays(14)); // 14 days is the max duration of a certificate for this
+ cert = new(crt.Export(X509ContentType.Pfx));
+
+ // Save
+ store.Add(cert);
+ }
+ store.Close();
+
+ var hash = SHA256.HashData(cert.RawData);
+ var certStr = Convert.ToBase64String(hash);
+ Console.WriteLine($"\n\n\n\n\nCertificate: {certStr}\n\n\n\n"); // <-- you will need to put this output into the JS API call to allo wthe connection
+ return cert;
+ }
}
diff --git a/src/Servers/Kestrel/shared/KnownHeaders.cs b/src/Servers/Kestrel/shared/KnownHeaders.cs
index c04451b3f9..8ce3eaecf8 100644
--- a/src/Servers/Kestrel/shared/KnownHeaders.cs
+++ b/src/Servers/Kestrel/shared/KnownHeaders.cs
@@ -27,6 +27,7 @@ public class KnownHeaders
HeaderNames.Connection,
HeaderNames.Scheme,
HeaderNames.Path,
+ HeaderNames.Protocol,
HeaderNames.Method,
HeaderNames.Authority,
HeaderNames.Host,
@@ -45,7 +46,8 @@ public class KnownHeaders
"Method", // :method
"Path", // :path
"Scheme", // :scheme
- "Status" // :status
+ "Status", // :status
+ "Protocol" // :protocol
};
public static readonly string[] NonApiHeaders =
@@ -132,6 +134,7 @@ public class KnownHeaders
HeaderNames.IfRange,
HeaderNames.IfUnmodifiedSince,
HeaderNames.MaxForwards,
+ HeaderNames.Protocol,
HeaderNames.ProxyAuthorization,
HeaderNames.Referer,
HeaderNames.Range,
diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/WebTransportTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/WebTransportTests.cs
new file mode 100644
index 0000000000..990752c0f5
--- /dev/null
+++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/WebTransportTests.cs
@@ -0,0 +1,138 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System.Net;
+using System.Net.Http;
+using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http3;
+using Microsoft.AspNetCore.Testing;
+using Microsoft.Net.Http.Headers;
+using Http3SettingType = Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http3.Http3SettingType;
+
+namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests;
+
+public class WebTransportTests : Http3TestBase
+{
+ [Fact]
+ public async Task WebTransportHandshake_ClientToServerPasses()
+ {
+ _serviceContext.ServerOptions.EnableWebTransportAndH3Datagrams = true;
+
+ await Http3Api.InitializeConnectionAsync(_noopApplication);
+ var controlStream = await Http3Api.CreateControlStream();
+ var controlStream2 = await Http3Api.GetInboundControlStream();
+
+ var settings = new Http3PeerSettings()
+ {
+ EnableWebTransport = 1,
+ H3Datagram = 1,
+ };
+
+ await controlStream.SendSettingsAsync(settings.GetNonProtocolDefaults());
+ var response1 = await controlStream2.ExpectSettingsAsync();
+
+ await Http3Api.ServerReceivedSettingsReader.ReadAsync().DefaultTimeout();
+
+ Assert.Equal(1, response1[(long)Http3SettingType.EnableWebTransport]);
+
+ var requestStream = await Http3Api.CreateRequestStream();
+ var headersConnectFrame = new[]
+ {
+ new KeyValuePair<string, string>(HeaderNames.Method, "CONNECT"),
+ new KeyValuePair<string, string>(HeaderNames.Protocol, "webtransport"),
+ new KeyValuePair<string, string>(HeaderNames.Scheme, "http"),
+ new KeyValuePair<string, string>(HeaderNames.Path, "/"),
+ new KeyValuePair<string, string>(HeaderNames.Authority, "server.example.com"),
+ new KeyValuePair<string, string>(HeaderNames.Origin, "server.example.com")
+ };
+
+ await requestStream.SendHeadersAsync(headersConnectFrame);
+ var response2 = await requestStream.ExpectHeadersAsync();
+
+ Assert.Equal((int)HttpStatusCode.OK, Convert.ToInt32(response2[HeaderNames.Status], null));
+
+ await requestStream.OnDisposedTask.DefaultTimeout();
+ }
+
+ [Theory]
+ [InlineData(
+ ((long)Http3ErrorCode.ProtocolError),
+ nameof(CoreStrings.Http3MethodMustBeConnectWhenUsingProtocolPseudoHeader),
+ nameof(HeaderNames.Method), "GET", // incorrect method (verifies that webtransport doesn't break regular Http/3 get)
+ nameof(HeaderNames.Protocol), "webtransport",
+ nameof(HeaderNames.Scheme), "http",
+ nameof(HeaderNames.Path), "/",
+ nameof(HeaderNames.Authority), "server.example.com",
+ nameof(HeaderNames.Origin), "server.example.com")]
+ [InlineData(
+ ((long)Http3ErrorCode.ProtocolError),
+ nameof(CoreStrings.Http3MissingAuthorityOrPathPseudoHeaders),
+ nameof(HeaderNames.Method), "CONNECT",
+ nameof(HeaderNames.Protocol), "webtransport",
+ nameof(HeaderNames.Scheme), "http",
+ nameof(HeaderNames.Authority), "server.example.com",
+ nameof(HeaderNames.Origin), "server.example.com")] // no path
+ [InlineData(
+ ((long)Http3ErrorCode.ProtocolError),
+ nameof(CoreStrings.Http3MissingAuthorityOrPathPseudoHeaders),
+ nameof(HeaderNames.Method), "CONNECT",
+ nameof(HeaderNames.Protocol), "webtransport",
+ nameof(HeaderNames.Scheme), "http",
+ nameof(HeaderNames.Path), "/",
+ nameof(HeaderNames.Origin), "server.example.com")] // no authority
+ public async Task WebTransportHandshake_IncorrectHeadersRejects(long error, string targetErrorMessage, params string[] headers) // todo replace the "" with CoreStrings.... then push (maybe also update the waitforstreamerror function) and resolve stephen's comment
+ {
+ _serviceContext.ServerOptions.EnableWebTransportAndH3Datagrams = true;
+
+ await Http3Api.InitializeConnectionAsync(_noopApplication);
+ var controlStream = await Http3Api.CreateControlStream();
+ var controlStream2 = await Http3Api.GetInboundControlStream();
+
+ var settings = new Http3PeerSettings()
+ {
+ EnableWebTransport = 1,
+ H3Datagram = 1,
+ };
+
+ await controlStream.SendSettingsAsync(settings.GetNonProtocolDefaults());
+ var response1 = await controlStream2.ExpectSettingsAsync();
+
+ await Http3Api.ServerReceivedSettingsReader.ReadAsync().DefaultTimeout();
+
+ Assert.Equal(1, response1[(long)Http3SettingType.EnableWebTransport]);
+
+ var requestStream = await Http3Api.CreateRequestStream();
+
+ var headersConnectFrame = new List<KeyValuePair<string, string>>();
+ for (var i = 0; i < headers.Length; i += 2)
+ {
+ headersConnectFrame.Add(new KeyValuePair<string, string>(GetHeaderFromName(headers[i]), headers[i + 1]));
+ }
+ await requestStream.SendHeadersAsync(headersConnectFrame);
+
+ await requestStream.WaitForStreamErrorAsync((Http3ErrorCode)error, AssertExpectedErrorMessages, GetCoreStringFromName(targetErrorMessage));
+ }
+
+ private static string GetCoreStringFromName(string headerName)
+ {
+ return headerName switch
+ {
+ nameof(CoreStrings.Http3MissingAuthorityOrPathPseudoHeaders) => CoreStrings.Http3MissingAuthorityOrPathPseudoHeaders,
+ nameof(CoreStrings.Http3MethodMustBeConnectWhenUsingProtocolPseudoHeader) => CoreStrings.Http3MethodMustBeConnectWhenUsingProtocolPseudoHeader,
+ _ => throw new Exception("Core string not mapped yet")
+ };
+ }
+
+ private static string GetHeaderFromName(string coreStringName)
+ {
+ return coreStringName switch
+ {
+ nameof(HeaderNames.Method) => HeaderNames.Method,
+ nameof(HeaderNames.Protocol) => HeaderNames.Protocol,
+ nameof(HeaderNames.Scheme) => HeaderNames.Scheme,
+ nameof(HeaderNames.Path) => HeaderNames.Path,
+ nameof(HeaderNames.Authority) => HeaderNames.Authority,
+ nameof(HeaderNames.Origin) => HeaderNames.Origin,
+ _ => throw new Exception("Header name not mapped yet")
+ };
+ }
+}
diff --git a/src/Shared/ParameterBindingMethodCache.cs b/src/Shared/ParameterBindingMethodCache.cs
index 03cd38756a..99418b0026 100644
--- a/src/Shared/ParameterBindingMethodCache.cs
+++ b/src/Shared/ParameterBindingMethodCache.cs
@@ -51,15 +51,18 @@ internal sealed class ParameterBindingMethodCache
_throwOnInvalidMethod = throwOnInvalidMethod;
}
+ [RequiresUnreferencedCode("Performs reflection on type hierarchy. This cannot be statically analyzed.")]
public bool HasTryParseMethod(Type type)
{
var nonNullableParameterType = Nullable.GetUnderlyingType(type) ?? type;
return FindTryParseMethod(nonNullableParameterType) is not null;
}
+ [RequiresUnreferencedCode("Performs reflection on type hierarchy. This cannot be statically analyzed.")]
public bool HasBindAsyncMethod(ParameterInfo parameter) =>
FindBindAsyncMethod(parameter).Expression is not null;
+ [RequiresUnreferencedCode("Performs reflection on type hierarchy. This cannot be statically analyzed.")]
public Func<ParameterExpression, Expression, Expression>? FindTryParseMethod(Type type)
{
Func<ParameterExpression, Expression, Expression>? Finder(Type type)
@@ -176,6 +179,7 @@ internal sealed class ParameterBindingMethodCache
return _stringMethodCallCache.GetOrAdd(type, Finder);
}
+ [RequiresUnreferencedCode("Performs reflection on type hierarchy. This cannot be statically analyzed.")]
public (Expression? Expression, int ParamCount) FindBindAsyncMethod(ParameterInfo parameter)
{
(Func<ParameterInfo, Expression>?, int) Finder(Type nonNullableParameterType)
@@ -406,6 +410,7 @@ internal sealed class ParameterBindingMethodCache
return candidateInterfaceMethodInfo;
}
+ [RequiresUnreferencedCode("Performs reflection on type hierarchy. This cannot be statically analyzed.")]
private static MethodInfo? GetAnyMethodFromHierarchy(Type type, string name)
{
// Find first incorrectly formatted method
diff --git a/src/Shared/runtime/Http3/Http3SettingType.cs b/src/Shared/runtime/Http3/Http3SettingType.cs
index 40958e3e0f..4919e8979c 100644
--- a/src/Shared/runtime/Http3/Http3SettingType.cs
+++ b/src/Shared/runtime/Http3/Http3SettingType.cs
@@ -33,6 +33,19 @@ namespace System.Net.Http
/// The maximum number of request streams that can be blocked waiting for QPack instructions. The default is 0.
/// https://tools.ietf.org/html/draft-ietf-quic-qpack-11#section-5
/// </summary>
- QPackBlockedStreams = 0x7
+ QPackBlockedStreams = 0x7,
+
+ /// <summary>
+ /// SETTINGS_ENABLE_WEBTRANSPORT, default is 0 (off)
+ /// https://www.ietf.org/archive/id/draft-ietf-webtrans-http3-01.html#name-http-3-settings-parameter-r
+ /// </summary>
+ EnableWebTransport = 0x2b603742,
+
+ /// <summary>
+ /// H3_DATAGRAM, default is 0 (off)
+ /// indicates that the server suppprts sending individual datagrams over Http/3
+ /// rather than just streams.
+ /// </summary>
+ H3Datagram = 0xffd277
}
}
diff --git a/src/Shared/runtime/NetEventSource.Common.cs b/src/Shared/runtime/NetEventSource.Common.cs
index b2ea95a05f..d7e41077e7 100644
--- a/src/Shared/runtime/NetEventSource.Common.cs
+++ b/src/Shared/runtime/NetEventSource.Common.cs
@@ -530,6 +530,7 @@ namespace System.Net
}
[NonEvent]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Can safely serialize primitive arguments.")]
private unsafe void WriteEvent(int eventId, string? arg1, int arg2, int arg3, int arg4)
{
if (IsEnabled())
@@ -568,6 +569,7 @@ namespace System.Net
}
[NonEvent]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Can safely serialize primitive arguments.")]
private unsafe void WriteEvent(int eventId, string? arg1, int arg2, string? arg3)
{
if (IsEnabled())
@@ -603,6 +605,7 @@ namespace System.Net
}
[NonEvent]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Can safely serialize primitive arguments.")]
private unsafe void WriteEvent(int eventId, string? arg1, string? arg2, int arg3)
{
if (IsEnabled())
@@ -638,6 +641,7 @@ namespace System.Net
}
[NonEvent]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Can safely serialize primitive arguments.")]
private unsafe void WriteEvent(int eventId, string? arg1, string? arg2, string? arg3, int arg4)
{
if (IsEnabled())
diff --git a/src/SignalR/clients/ts/FunctionalTests/package.json b/src/SignalR/clients/ts/FunctionalTests/package.json
index a70a246bd1..19516bb10e 100644
--- a/src/SignalR/clients/ts/FunctionalTests/package.json
+++ b/src/SignalR/clients/ts/FunctionalTests/package.json
@@ -54,7 +54,6 @@
},
"resolutions": {
"lodash": ">=4.17.21",
- "url-parse": ">=1.5.6",
"ua-parser-js": "^0.7.30",
"minimist": ">=1.2.6",
"ws": ">=7.4.6"
diff --git a/src/SignalR/clients/ts/FunctionalTests/ts/ConnectionTests.ts b/src/SignalR/clients/ts/FunctionalTests/ts/ConnectionTests.ts
index 9d2d6bf423..aaf622c571 100644
--- a/src/SignalR/clients/ts/FunctionalTests/ts/ConnectionTests.ts
+++ b/src/SignalR/clients/ts/FunctionalTests/ts/ConnectionTests.ts
@@ -201,6 +201,9 @@ describe("connection", () => {
const connection = new HttpConnection(USED_ECHOENDPOINT_URL + "redirect", {
...commonOptions,
httpClient,
+ // bug in eventsource makes relative redirect URLs throw an unhandled exception which fails the test
+ // https://github.com/EventSource/eventsource/issues/277
+ transport: HttpTransportType.WebSockets | HttpTransportType.LongPolling
});
connection.onreceive = async (data: any) => {
diff --git a/src/SignalR/clients/ts/FunctionalTests/ts/HubConnectionTests.ts b/src/SignalR/clients/ts/FunctionalTests/ts/HubConnectionTests.ts
index 2b9d6efacb..676aa698d1 100644
--- a/src/SignalR/clients/ts/FunctionalTests/ts/HubConnectionTests.ts
+++ b/src/SignalR/clients/ts/FunctionalTests/ts/HubConnectionTests.ts
@@ -1019,29 +1019,6 @@ describe("hubConnection", () => {
}
});
- it("populates the Content-Type header when sending XMLHttpRequest", async () => {
- // Skip test on Node as this header isn't set (it was added for React-Native)
- if (typeof window === "undefined") {
- return;
- }
- const hubConnection = getConnectionBuilder(HttpTransportType.LongPolling, TESTHUB_NOWEBSOCKETS_ENDPOINT_URL)
- .withHubProtocol(new JsonHubProtocol())
- .build();
-
- try {
- await hubConnection.start();
-
- // Check what transport was used by asking the server to tell us.
- expect(await hubConnection.invoke("GetActiveTransportName")).toEqual("LongPolling");
- // Check to see that the Content-Type header is set the expected value
- expect(await hubConnection.invoke("GetContentTypeHeader")).toEqual("text/plain;charset=UTF-8");
-
- await hubConnection.stop();
- } catch (e) {
- fail(e);
- }
- });
-
eachTransport((t) => {
it("sets the user agent header", async () => {
const hubConnection = getConnectionBuilder(t, TESTHUBENDPOINT_URL)
diff --git a/src/SignalR/clients/ts/FunctionalTests/yarn.lock b/src/SignalR/clients/ts/FunctionalTests/yarn.lock
index 6750e6fb5a..09630f49dd 100644
--- a/src/SignalR/clients/ts/FunctionalTests/yarn.lock
+++ b/src/SignalR/clients/ts/FunctionalTests/yarn.lock
@@ -1377,12 +1377,10 @@ events@^3.2.0:
resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400"
integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==
-eventsource@^1.0.7:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-1.1.0.tgz#00e8ca7c92109e94b0ddf32dac677d841028cfaf"
- integrity sha512-VSJjT5oCNrFvCS6igjzPAt5hBzQ2qPBFIbJ03zLI9SE0mxwZpMw6BfJrbFHm1a141AavMEB8JHmBhWAd66PfCg==
- dependencies:
- original "^1.0.0"
+eventsource@^2.0.2:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-2.0.2.tgz#76dfcc02930fb2ff339520b6d290da573a9e8508"
+ integrity sha512-IzUmBGPR3+oUG9dUeXynyNmf91/3zUSJg1lCktzKw47OXuhco54U3r9B7O4XX+Rb1Itm9OZ2b0RkTs10bICOxA==
execa@^0.7.0:
version "0.7.0"
@@ -1475,12 +1473,13 @@ fd-slicer@~1.1.0:
dependencies:
pend "~1.2.0"
-fetch-cookie@^0.11.0:
- version "0.11.0"
- resolved "https://registry.yarnpkg.com/fetch-cookie/-/fetch-cookie-0.11.0.tgz#e046d2abadd0ded5804ce7e2cae06d4331c15407"
- integrity sha512-BQm7iZLFhMWFy5CZ/162sAGjBfdNWb7a8LEqqnzsHFhxT/X/SVj/z2t2nu3aJvjlbQkrAlTUApplPRjWyH4mhA==
+fetch-cookie@^2.0.3:
+ version "2.0.5"
+ resolved "https://registry.yarnpkg.com/fetch-cookie/-/fetch-cookie-2.0.5.tgz#d49b0886f79c71ce927245d928b9c230a2ddc69e"
+ integrity sha512-zsX/vrrLLCrLUKS/45u/NqZDwRSyopUscM/0huSH5clYe8dmkxIiDs3g4po+f5baWiXiTAOqPMtflP80CtR5rA==
dependencies:
- tough-cookie "^2.3.3 || ^3.0.1 || ^4.0.0"
+ set-cookie-parser "^2.4.8"
+ tough-cookie "^4.0.0"
file-type@^3.8.0:
version "3.9.0"
@@ -2517,13 +2516,6 @@ once@^1.3.0, once@^1.3.1, once@^1.4.0:
dependencies:
wrappy "1"
-original@^1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/original/-/original-1.0.2.tgz#e442a61cffe1c5fd20a65f3261c26663b303f25f"
- integrity sha512-hyBVl6iqqUOJ8FqRe+l/gS8H+kKYjrEndd5Pm1MfBtsEKA038HkkdbAl/72EAXGyonD/PFsvmVG+EvcIpliMBg==
- dependencies:
- url-parse "^1.4.3"
-
os-filter-obj@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/os-filter-obj/-/os-filter-obj-2.0.0.tgz#1c0b62d5f3a2442749a2d139e6dddee6e81d8d16"
@@ -2767,11 +2759,6 @@ query-string@^5.0.1:
object-assign "^4.1.0"
strict-uri-encode "^1.0.0"
-querystringify@^2.1.1:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6"
- integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==
-
quick-lru@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932"
@@ -3010,6 +2997,11 @@ serialize-javascript@^6.0.0:
dependencies:
randombytes "^2.1.0"
+set-cookie-parser@^2.4.8:
+ version "2.4.8"
+ resolved "https://registry.yarnpkg.com/set-cookie-parser/-/set-cookie-parser-2.4.8.tgz#d0da0ed388bc8f24e706a391f9c9e252a13c58b2"
+ integrity sha512-edRH8mBKEWNVIVMKejNnuJxleqYE/ZSdcT8/Nem9/mmosx12pctd80s2Oy00KNZzrogMZS5mauK2/ymL1bvlvg==
+
setprototypeof@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683"
@@ -3303,7 +3295,7 @@ toidentifier@1.0.0:
resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553"
integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==
-"tough-cookie@^2.3.3 || ^3.0.1 || ^4.0.0":
+tough-cookie@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.0.0.tgz#d822234eeca882f991f0f908824ad2622ddbece4"
integrity sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==
@@ -3436,14 +3428,6 @@ url-parse-lax@^3.0.0:
dependencies:
prepend-http "^2.0.0"
-url-parse@>=1.5.6, url-parse@^1.4.3:
- version "1.5.10"
- resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1"
- integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==
- dependencies:
- querystringify "^2.1.1"
- requires-port "^1.0.0"
-
url-to-options@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9"
diff --git a/src/SignalR/clients/ts/signalr/package.json b/src/SignalR/clients/ts/signalr/package.json
index 1fdd32c78c..52c57f9863 100644
--- a/src/SignalR/clients/ts/signalr/package.json
+++ b/src/SignalR/clients/ts/signalr/package.json
@@ -44,7 +44,7 @@
"src/**/*"
],
"devDependencies": {
- "@types/eventsource": "^1.1.5",
+ "@types/eventsource": "^1.1.8",
"@types/jest": "^26.0.20",
"@types/node": "^14.14.31",
"@types/tough-cookie": "^4.0.0",
@@ -52,13 +52,12 @@
},
"dependencies": {
"abort-controller": "^3.0.0",
- "eventsource": "^1.0.7",
- "fetch-cookie": "^0.11.0",
+ "eventsource": "^2.0.2",
+ "fetch-cookie": "^2.0.3",
"node-fetch": "^2.6.7",
"ws": "^7.4.5"
},
"resolutions": {
- "ansi-regex": "5.0.1",
- "url-parse": ">=1.5.6"
+ "ansi-regex": "5.0.1"
}
}
diff --git a/src/SignalR/clients/ts/signalr/src/FetchHttpClient.ts b/src/SignalR/clients/ts/signalr/src/FetchHttpClient.ts
index b7eef31951..9dd3610aa0 100644
--- a/src/SignalR/clients/ts/signalr/src/FetchHttpClient.ts
+++ b/src/SignalR/clients/ts/signalr/src/FetchHttpClient.ts
@@ -7,7 +7,7 @@ import { CookieJar } from "@types/tough-cookie";
import { AbortError, HttpError, TimeoutError } from "./Errors";
import { HttpClient, HttpRequest, HttpResponse } from "./HttpClient";
import { ILogger, LogLevel } from "./ILogger";
-import { Platform, getGlobalThis } from "./Utils";
+import { Platform, getGlobalThis, isArrayBuffer } from "./Utils";
export class FetchHttpClient extends HttpClient {
private readonly _abortControllerType: { prototype: AbortController, new(): AbortController };
@@ -84,14 +84,26 @@ export class FetchHttpClient extends HttpClient {
}, msTimeout);
}
+ if (request.content === "") {
+ request.content = undefined;
+ }
+ if (request.content) {
+ // Explicitly setting the Content-Type header for React Native on Android platform.
+ request.headers = request.headers || {};
+ if (isArrayBuffer(request.content)) {
+ request.headers["Content-Type"] = "application/octet-stream";
+ } else {
+ request.headers["Content-Type"] = "text/plain;charset=UTF-8";
+ }
+ }
+
let response: Response;
try {
response = await this._fetchType(request.url!, {
- body: request.content!,
+ body: request.content,
cache: "no-cache",
credentials: request.withCredentials === true ? "include" : "same-origin",
headers: {
- "Content-Type": "text/plain;charset=UTF-8",
"X-Requested-With": "XMLHttpRequest",
...request.headers,
},
diff --git a/src/SignalR/clients/ts/signalr/src/XhrHttpClient.ts b/src/SignalR/clients/ts/signalr/src/XhrHttpClient.ts
index 8812d1218f..21992813c6 100644
--- a/src/SignalR/clients/ts/signalr/src/XhrHttpClient.ts
+++ b/src/SignalR/clients/ts/signalr/src/XhrHttpClient.ts
@@ -4,6 +4,7 @@
import { AbortError, HttpError, TimeoutError } from "./Errors";
import { HttpClient, HttpRequest, HttpResponse } from "./HttpClient";
import { ILogger, LogLevel } from "./ILogger";
+import { isArrayBuffer } from "./Utils";
export class XhrHttpClient extends HttpClient {
private readonly _logger: ILogger;
@@ -33,8 +34,17 @@ export class XhrHttpClient extends HttpClient {
xhr.open(request.method!, request.url!, true);
xhr.withCredentials = request.withCredentials === undefined ? true : request.withCredentials;
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
- // Explicitly setting the Content-Type header for React Native on Android platform.
- xhr.setRequestHeader("Content-Type", "text/plain;charset=UTF-8");
+ if (request.content === "") {
+ request.content = undefined;
+ }
+ if (request.content) {
+ // Explicitly setting the Content-Type header for React Native on Android platform.
+ if (isArrayBuffer(request.content)) {
+ xhr.setRequestHeader("Content-Type", "application/octet-stream");
+ } else {
+ xhr.setRequestHeader("Content-Type", "text/plain;charset=UTF-8");
+ }
+ }
const headers = request.headers;
if (headers) {
@@ -81,7 +91,7 @@ export class XhrHttpClient extends HttpClient {
reject(new TimeoutError());
};
- xhr.send(request.content || "");
+ xhr.send(request.content);
});
}
}
diff --git a/src/SignalR/clients/ts/signalr/tests/FetchHttpClient.test.ts b/src/SignalR/clients/ts/signalr/tests/FetchHttpClient.test.ts
index e31c0e1274..5f7432392e 100644
--- a/src/SignalR/clients/ts/signalr/tests/FetchHttpClient.test.ts
+++ b/src/SignalR/clients/ts/signalr/tests/FetchHttpClient.test.ts
@@ -17,4 +17,52 @@ describe("FetchHttpClient", () => {
expect(e).toEqual(new Error("error from test"));
}
});
+
+ it("sets Content-type header for plaintext", async () => {
+ (global.fetch as any) = (_: string, request: RequestInit) => {
+ expect((request.headers as any)!["Content-Type"]).toEqual("text/plain;charset=UTF-8")
+ throw new Error("error from test");
+ };
+ const httpClient = new FetchHttpClient(NullLogger.instance);
+
+ try {
+ await httpClient.post("/", { content: "content" });
+ } catch (e) {
+ expect(e).toEqual(new Error("error from test"));
+ }
+ });
+
+ it("sets Content-Type header for binary", async () => {
+ (global.fetch as any) = (_: string, request: RequestInit) => {
+ expect((request.headers as any)!["Content-Type"]).toEqual("application/octet-stream")
+ throw new Error("error from test");
+ };
+ const httpClient = new FetchHttpClient(NullLogger.instance);
+
+ try {
+ await httpClient.post("/", { content: new ArrayBuffer(1) });
+ } catch (e) {
+ expect(e).toEqual(new Error("error from test"));
+ }
+ });
+
+ it("does not set Content-Type header for empty content", async () => {
+ (global.fetch as any) = (_: string, request: RequestInit) => {
+ expect((request.headers as any)!["Content-Type"]).toBeUndefined()
+ throw new Error("error from test");
+ };
+ const httpClient = new FetchHttpClient(NullLogger.instance);
+
+ try {
+ await httpClient.post("/", { content: "" });
+ } catch (e) {
+ expect(e).toEqual(new Error("error from test"));
+ }
+
+ try {
+ await httpClient.post("/");
+ } catch (e) {
+ expect(e).toEqual(new Error("error from test"));
+ }
+ });
});
diff --git a/src/SignalR/clients/ts/signalr/yarn.lock b/src/SignalR/clients/ts/signalr/yarn.lock
index 1c2bf76eec..095e4a6e0f 100644
--- a/src/SignalR/clients/ts/signalr/yarn.lock
+++ b/src/SignalR/clients/ts/signalr/yarn.lock
@@ -13,10 +13,10 @@
"@types/yargs" "^15.0.0"
chalk "^4.0.0"
-"@types/eventsource@^1.1.5":
- version "1.1.5"
- resolved "https://registry.yarnpkg.com/@types/eventsource/-/eventsource-1.1.5.tgz#408e9b45efb176c8bea672ab58c81e7ab00d24bc"
- integrity sha512-BA9q9uC2PAMkUS7DunHTxWZZaVpeNzDG8lkBxcKwzKJClfDQ4Z59/Csx7HSH/SIqFN2JWh0tAKAM6k/wRR0OZg==
+"@types/eventsource@^1.1.8":
+ version "1.1.8"
+ resolved "https://registry.yarnpkg.com/@types/eventsource/-/eventsource-1.1.8.tgz#48ae1f3aaf9bb84c713038f354112cc7ceaad519"
+ integrity sha512-fJQNt9LijJCZwYvM6O30uLzdpAK9zs52Uc9iUW9M2Zsg0HQM6DLf6QysjC/wuFX+0798B8AppVMvgdO6IftPKQ==
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0":
version "2.0.3"
@@ -121,19 +121,18 @@ event-target-shim@^5.0.0:
resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789"
integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==
-eventsource@^1.0.7:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-1.1.0.tgz#00e8ca7c92109e94b0ddf32dac677d841028cfaf"
- integrity sha512-VSJjT5oCNrFvCS6igjzPAt5hBzQ2qPBFIbJ03zLI9SE0mxwZpMw6BfJrbFHm1a141AavMEB8JHmBhWAd66PfCg==
- dependencies:
- original "^1.0.0"
+eventsource@^2.0.2:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-2.0.2.tgz#76dfcc02930fb2ff339520b6d290da573a9e8508"
+ integrity sha512-IzUmBGPR3+oUG9dUeXynyNmf91/3zUSJg1lCktzKw47OXuhco54U3r9B7O4XX+Rb1Itm9OZ2b0RkTs10bICOxA==
-fetch-cookie@^0.11.0:
- version "0.11.0"
- resolved "https://registry.yarnpkg.com/fetch-cookie/-/fetch-cookie-0.11.0.tgz#e046d2abadd0ded5804ce7e2cae06d4331c15407"
- integrity sha512-BQm7iZLFhMWFy5CZ/162sAGjBfdNWb7a8LEqqnzsHFhxT/X/SVj/z2t2nu3aJvjlbQkrAlTUApplPRjWyH4mhA==
+fetch-cookie@^2.0.3:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/fetch-cookie/-/fetch-cookie-2.0.3.tgz#e81a364d1fb1952f4ba3aa7881025d6c4a758b15"
+ integrity sha512-Awxvuqsf0Rc4tckszW1iJpBIRrKwEiYDL/XxQkRhpCTcuQdiCN1XP9MFOyzGaGbf0MU7gjBkcgwxT7IyjpCz3g==
dependencies:
- tough-cookie "^2.3.3 || ^3.0.1 || ^4.0.0"
+ set-cookie-parser "^2.4.8"
+ tough-cookie "^4.0.0"
has-flag@^4.0.0:
version "4.0.0"
@@ -162,13 +161,6 @@ node-fetch@^2.6.7:
dependencies:
whatwg-url "^5.0.0"
-original@^1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/original/-/original-1.0.2.tgz#e442a61cffe1c5fd20a65f3261c26663b303f25f"
- integrity sha512-hyBVl6iqqUOJ8FqRe+l/gS8H+kKYjrEndd5Pm1MfBtsEKA038HkkdbAl/72EAXGyonD/PFsvmVG+EvcIpliMBg==
- dependencies:
- url-parse "^1.4.3"
-
pretty-format@^26.0.0, pretty-format@^26.6.2:
version "26.6.2"
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93"
@@ -194,20 +186,15 @@ punycode@^2.1.1:
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
-querystringify@^2.1.1:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6"
- integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==
-
react-is@^17.0.1:
version "17.0.2"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==
-requires-port@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
- integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=
+set-cookie-parser@^2.4.8:
+ version "2.4.8"
+ resolved "https://registry.yarnpkg.com/set-cookie-parser/-/set-cookie-parser-2.4.8.tgz#d0da0ed388bc8f24e706a391f9c9e252a13c58b2"
+ integrity sha512-edRH8mBKEWNVIVMKejNnuJxleqYE/ZSdcT8/Nem9/mmosx12pctd80s2Oy00KNZzrogMZS5mauK2/ymL1bvlvg==
supports-color@^7.1.0:
version "7.2.0"
@@ -216,7 +203,7 @@ supports-color@^7.1.0:
dependencies:
has-flag "^4.0.0"
-"tough-cookie@^2.3.3 || ^3.0.1 || ^4.0.0":
+tough-cookie@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.0.0.tgz#d822234eeca882f991f0f908824ad2622ddbece4"
integrity sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==
@@ -235,14 +222,6 @@ universalify@^0.1.2:
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==
-url-parse@>=1.5.6, url-parse@^1.4.3:
- version "1.5.10"
- resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1"
- integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==
- dependencies:
- querystringify "^2.1.1"
- requires-port "^1.0.0"
-
webidl-conversions@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
diff --git a/src/SignalR/server/Core/src/IHubClients`T.cs b/src/SignalR/server/Core/src/IHubClients`T.cs
index 0dee6f33b1..06dce7a609 100644
--- a/src/SignalR/server/Core/src/IHubClients`T.cs
+++ b/src/SignalR/server/Core/src/IHubClients`T.cs
@@ -14,7 +14,7 @@ public interface IHubClients<T>
/// </summary>
/// <param name="connectionId">The connection ID.</param>
/// <returns>A client caller.</returns>
- T Single(string connectionId) => throw new NotImplementedException();
+ T Single(string connectionId) => Client(connectionId);
/// <summary>
/// Gets a <typeparamref name="T" /> that can be used to invoke methods on all clients connected to the hub.
diff --git a/src/SignalR/server/Core/src/Internal/HubClients.cs b/src/SignalR/server/Core/src/Internal/HubClients.cs
index 9c87ef5388..9ddaee52eb 100644
--- a/src/SignalR/server/Core/src/Internal/HubClients.cs
+++ b/src/SignalR/server/Core/src/Internal/HubClients.cs
@@ -15,7 +15,7 @@ internal sealed class HubClients<THub> : IHubClients where THub : Hub
public ISingleClientProxy Single(string connectionId)
{
- return new SingleClientProxyWithInvoke<THub>(_lifetimeManager, connectionId);
+ return new SingleClientProxy<THub>(_lifetimeManager, connectionId);
}
public IClientProxy All { get; }
diff --git a/src/SignalR/server/Core/src/Internal/HubClients`T.cs b/src/SignalR/server/Core/src/Internal/HubClients`T.cs
index 4e5a1e45ec..e168174b64 100644
--- a/src/SignalR/server/Core/src/Internal/HubClients`T.cs
+++ b/src/SignalR/server/Core/src/Internal/HubClients`T.cs
@@ -15,11 +15,6 @@ internal sealed class HubClients<THub, T> : IHubClients<T> where THub : Hub
public T All { get; }
- public T Single(string connectionId)
- {
- return TypedClientBuilder<T>.Build(new SingleClientProxyWithInvoke<THub>(_lifetimeManager, connectionId));
- }
-
public T AllExcept(IReadOnlyList<string> excludedConnectionIds)
{
return TypedClientBuilder<T>.Build(new AllClientsExceptProxy<THub>(_lifetimeManager, excludedConnectionIds));
diff --git a/src/SignalR/server/Core/src/Internal/Proxies.cs b/src/SignalR/server/Core/src/Internal/Proxies.cs
index 440a050406..46f42beead 100644
--- a/src/SignalR/server/Core/src/Internal/Proxies.cs
+++ b/src/SignalR/server/Core/src/Internal/Proxies.cs
@@ -122,23 +122,6 @@ internal sealed class AllClientsExceptProxy<THub> : IClientProxy where THub : Hu
}
}
-internal sealed class SingleClientProxy<THub> : IClientProxy where THub : Hub
-{
- private readonly string _connectionId;
- private readonly HubLifetimeManager<THub> _lifetimeManager;
-
- public SingleClientProxy(HubLifetimeManager<THub> lifetimeManager, string connectionId)
- {
- _lifetimeManager = lifetimeManager;
- _connectionId = connectionId;
- }
-
- public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default)
- {
- return _lifetimeManager.SendConnectionAsync(_connectionId, method, args, cancellationToken);
- }
-}
-
internal sealed class MultipleClientProxy<THub> : IClientProxy where THub : Hub
{
private readonly HubLifetimeManager<THub> _lifetimeManager;
@@ -156,12 +139,12 @@ internal sealed class MultipleClientProxy<THub> : IClientProxy where THub : Hub
}
}
-internal sealed class SingleClientProxyWithInvoke<THub> : ISingleClientProxy where THub : Hub
+internal sealed class SingleClientProxy<THub> : ISingleClientProxy where THub : Hub
{
private readonly string _connectionId;
private readonly HubLifetimeManager<THub> _lifetimeManager;
- public SingleClientProxyWithInvoke(HubLifetimeManager<THub> lifetimeManager, string connectionId)
+ public SingleClientProxy(HubLifetimeManager<THub> lifetimeManager, string connectionId)
{
_lifetimeManager = lifetimeManager;
_connectionId = connectionId;
diff --git a/src/SignalR/server/Core/src/Internal/TypedHubClients.cs b/src/SignalR/server/Core/src/Internal/TypedHubClients.cs
index 3a8e68ae38..fa7023ac33 100644
--- a/src/SignalR/server/Core/src/Internal/TypedHubClients.cs
+++ b/src/SignalR/server/Core/src/Internal/TypedHubClients.cs
@@ -12,7 +12,7 @@ internal sealed class TypedHubClients<T> : IHubCallerClients<T>
_hubClients = dynamicContext;
}
- public T Single(string connectionId) => TypedClientBuilder<T>.Build(_hubClients.Single(connectionId));
+ public T Client(string connectionId) => TypedClientBuilder<T>.Build(_hubClients.Single(connectionId));
public T All => TypedClientBuilder<T>.Build(_hubClients.All);
@@ -22,11 +22,6 @@ internal sealed class TypedHubClients<T> : IHubCallerClients<T>
public T AllExcept(IReadOnlyList<string> excludedConnectionIds) => TypedClientBuilder<T>.Build(_hubClients.AllExcept(excludedConnectionIds));
- public T Client(string connectionId)
- {
- return TypedClientBuilder<T>.Build(_hubClients.Client(connectionId));
- }
-
public T Group(string groupName)
{
return TypedClientBuilder<T>.Build(_hubClients.Group(groupName));
diff --git a/src/SignalR/server/SignalR/test/ClientProxyTests.cs b/src/SignalR/server/SignalR/test/ClientProxyTests.cs
index ede98b1c50..784fc98bf0 100644
--- a/src/SignalR/server/SignalR/test/ClientProxyTests.cs
+++ b/src/SignalR/server/SignalR/test/ClientProxyTests.cs
@@ -212,7 +212,7 @@ public class ClientHubProxyTests
{
var hubLifetimeManager = new EmptyHubLifetimeManager<FakeHub>();
- var proxy = new SingleClientProxyWithInvoke<FakeHub>(hubLifetimeManager, "");
+ var proxy = new SingleClientProxy<FakeHub>(hubLifetimeManager, "");
var ex = await Assert.ThrowsAsync<NotImplementedException>(async () => await proxy.InvokeAsync<int>("method")).DefaultTimeout();
Assert.Equal("EmptyHubLifetimeManager`1 does not support client return values.", ex.Message);
}
diff --git a/src/SignalR/server/SignalR/test/HubConnectionHandlerTestUtils/Hubs.cs b/src/SignalR/server/SignalR/test/HubConnectionHandlerTestUtils/Hubs.cs
index 75d7191c30..f72cd15f3b 100644
--- a/src/SignalR/server/SignalR/test/HubConnectionHandlerTestUtils/Hubs.cs
+++ b/src/SignalR/server/SignalR/test/HubConnectionHandlerTestUtils/Hubs.cs
@@ -440,7 +440,7 @@ public class DynamicTestHub : DynamicHub
}
}
-public class HubT : Hub<Test>
+public class HubT : Hub<ITest>
{
public override Task OnConnectedAsync()
{
@@ -524,9 +524,15 @@ public class HubT : Hub<Test>
{
return Clients.Caller.Send(message);
}
+
+ public async Task<ClientResults> GetClientResultThreeWays(int singleValue, int clientValue, int callerValue) =>
+ new ClientResults(
+ await Clients.Single(Context.ConnectionId).GetClientResult(singleValue),
+ await Clients.Client(Context.ConnectionId).GetClientResult(clientValue),
+ await Clients.Caller.GetClientResult(callerValue));
}
-public interface Test
+public interface ITest
{
Task Send(string message);
Task Broadcast(string message);
@@ -534,6 +540,8 @@ public interface Test
Task<int> GetClientResult(int value);
}
+public record ClientResults(int SingleResult, int ClientResult, int CallerResult);
+
public class OnConnectedThrowsHub : Hub
{
public override Task OnConnectedAsync()
diff --git a/src/SignalR/server/SignalR/test/HubConnectionHandlerTests.ClientResult.cs b/src/SignalR/server/SignalR/test/HubConnectionHandlerTests.ClientResult.cs
index 06d929c910..8fdf84cc68 100644
--- a/src/SignalR/server/SignalR/test/HubConnectionHandlerTests.ClientResult.cs
+++ b/src/SignalR/server/SignalR/test/HubConnectionHandlerTests.ClientResult.cs
@@ -145,26 +145,75 @@ public partial class HubConnectionHandlerTests
var connectionHandler = serviceProvider.GetService<HubConnectionHandler<HubT>>();
using var client = new TestClient();
+ var connectionId = client.Connection.ConnectionId;
var connectionHandlerTask = await client.ConnectAsync(connectionHandler);
// Wait for a connection, or for the endpoint to fail.
await client.Connected.OrThrowIfOtherFails(connectionHandlerTask).DefaultTimeout();
- var context = serviceProvider.GetRequiredService<IHubContext<HubT, Test>>();
- var resultTask = context.Clients.Single(client.Connection.ConnectionId).GetClientResult(1);
+ var context = serviceProvider.GetRequiredService<IHubContext<HubT, ITest>>();
- var message = await client.ReadAsync().DefaultTimeout();
- var invocation = Assert.IsType<InvocationMessage>(message);
+ async Task AssertClientResult(Task<int> resultTask)
+ {
+ var message = await client.ReadAsync().DefaultTimeout();
+ var invocation = Assert.IsType<InvocationMessage>(message);
- Assert.Single(invocation.Arguments);
- Assert.Equal(1L, invocation.Arguments[0]);
- Assert.Equal("GetClientResult", invocation.Target);
+ Assert.Single(invocation.Arguments);
+ Assert.Equal(1L, invocation.Arguments[0]);
+ Assert.Equal("GetClientResult", invocation.Target);
- await client.SendHubMessageAsync(CompletionMessage.WithResult(invocation.InvocationId, 2)).DefaultTimeout();
+ await client.SendHubMessageAsync(CompletionMessage.WithResult(invocation.InvocationId, 2)).DefaultTimeout();
- var result = await resultTask.DefaultTimeout();
- Assert.Equal(2, result);
+ var result = await resultTask.DefaultTimeout();
+ Assert.Equal(2, result);
+ }
+
+ await AssertClientResult(context.Clients.Single(connectionId).GetClientResult(1));
+ await AssertClientResult(context.Clients.Client(connectionId).GetClientResult(1));
}
}
+
+ [Fact]
+ public async Task CanReturnClientResultToTypedHubThreeWays()
+ {
+ using (StartVerifiableLog())
+ {
+ var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(builder =>
+ {
+ // Waiting for a client result blocks the hub dispatcher pipeline, need to allow multiple invocations
+ builder.AddSignalR(o => o.MaximumParallelInvocationsPerClient = 2);
+ }, LoggerFactory);
+ var connectionHandler = serviceProvider.GetService<HubConnectionHandler<HubT>>();
+
+ using var client = new TestClient(invocationBinder: new GetClientResultThreeWaysInvocationBinder());
+
+ var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout();
+
+ var invocationId = await client.SendHubMessageAsync(new InvocationMessage(
+ invocationId: "1",
+ nameof(HubT.GetClientResultThreeWays),
+ new object[] { 5, 6, 7 })).DefaultTimeout();
+
+ // Send back "value + 4" to all three invocations.
+ for (int i = 0; i < 3; i++)
+ {
+ // Hub asks client for a result, this is an invocation message with an ID.
+ var invocationMessage = Assert.IsType<InvocationMessage>(await client.ReadAsync().DefaultTimeout());
+ Assert.NotNull(invocationMessage.InvocationId);
+ var res = 4 + (int)invocationMessage.Arguments[0];
+ await client.SendHubMessageAsync(CompletionMessage.WithResult(invocationMessage.InvocationId, res)).DefaultTimeout();
+ }
+
+ var completion = Assert.IsType<CompletionMessage>(await client.ReadAsync().DefaultTimeout());
+ Assert.Equal(new ClientResults(9, 10, 11), completion.Result);
+ }
+ }
+
+ private class GetClientResultThreeWaysInvocationBinder : IInvocationBinder
+ {
+ public IReadOnlyList<Type> GetParameterTypes(string methodName) => new[] { typeof(int) };
+ public Type GetReturnType(string invocationId) => typeof(ClientResults);
+ public Type GetStreamItemType(string streamId) => throw new NotImplementedException();
+ }
}
diff --git a/src/SignalR/server/StackExchangeRedis/src/Internal/RedisLog.cs b/src/SignalR/server/StackExchangeRedis/src/Internal/RedisLog.cs
index ba7217748a..5df4804c52 100644
--- a/src/SignalR/server/StackExchangeRedis/src/Internal/RedisLog.cs
+++ b/src/SignalR/server/StackExchangeRedis/src/Internal/RedisLog.cs
@@ -58,6 +58,9 @@ internal static partial class RedisLog
[LoggerMessage(13, LogLevel.Error, "Error forwarding client result with ID '{InvocationID}' to server.", EventName = "ErrorForwardingResult")]
public static partial void ErrorForwardingResult(ILogger logger, string invocationId, Exception ex);
+ [LoggerMessage(14, LogLevel.Error, "Error connecting to Redis.", EventName = "ErrorConnecting")]
+ public static partial void ErrorConnecting(ILogger logger, Exception ex);
+
// This isn't DefineMessage-based because it's just the simple TextWriter logging from ConnectionMultiplexer
public static void ConnectionMultiplexerMessage(ILogger logger, string? message)
{
diff --git a/src/SignalR/server/StackExchangeRedis/src/RedisHubLifetimeManager.cs b/src/SignalR/server/StackExchangeRedis/src/RedisHubLifetimeManager.cs
index 7d81db872d..4b353b53e7 100644
--- a/src/SignalR/server/StackExchangeRedis/src/RedisHubLifetimeManager.cs
+++ b/src/SignalR/server/StackExchangeRedis/src/RedisHubLifetimeManager.cs
@@ -35,6 +35,7 @@ public class RedisHubLifetimeManager<THub> : HubLifetimeManager<THub>, IDisposab
private readonly SemaphoreSlim _connectionLock = new SemaphoreSlim(1);
private readonly IHubProtocolResolver _hubProtocolResolver;
private readonly ClientResultsManager _clientResultsManager = new();
+ private bool _redisConnectErrorLogged;
private readonly AckHandler _ackHandler;
private int _internalAckId;
@@ -90,6 +91,7 @@ public class RedisHubLifetimeManager<THub> : HubLifetimeManager<THub>, IDisposab
public override async Task OnConnectedAsync(HubConnectionContext connection)
{
await EnsureRedisServerConnection();
+
var feature = new RedisFeature();
connection.Features.Set<IRedisFeature>(feature);
@@ -112,11 +114,17 @@ public class RedisHubLifetimeManager<THub> : HubLifetimeManager<THub>, IDisposab
{
_connections.Remove(connection);
- var tasks = new List<Task>();
+ // If the bus is null then the Redis connection failed to be established and none of the other connection setup ran
+ if (_bus is null)
+ {
+ return Task.CompletedTask;
+ }
var connectionChannel = _channels.Connection(connection.ConnectionId);
+ var tasks = new List<Task>();
+
RedisLog.Unsubscribe(_logger, connectionChannel);
- tasks.Add(_bus!.UnsubscribeAsync(connectionChannel));
+ tasks.Add(_bus.UnsubscribeAsync(connectionChannel));
var feature = connection.Features.GetRequiredFeature<IRedisFeature>();
var groupNames = feature.Groups;
@@ -704,7 +712,21 @@ public class RedisHubLifetimeManager<THub> : HubLifetimeManager<THub>, IDisposab
if (_redisServerConnection == null)
{
var writer = new LoggerTextWriter(_logger);
- _redisServerConnection = await _options.ConnectAsync(writer);
+ try
+ {
+ _redisServerConnection = await _options.ConnectAsync(writer);
+ }
+ catch (Exception ex)
+ {
+ // If the connection hasn't been established yet we shouldn't keep logging the same error over and over
+ // for every new client connection.
+ if (!_redisConnectErrorLogged)
+ {
+ RedisLog.ErrorConnecting(_logger, ex);
+ _redisConnectErrorLogged = true;
+ }
+ throw;
+ }
_bus = _redisServerConnection.GetSubscriber();
_redisServerConnection.ConnectionRestored += (_, e) =>
diff --git a/src/SignalR/server/StackExchangeRedis/test/RedisHubLifetimeManagerTests.cs b/src/SignalR/server/StackExchangeRedis/test/RedisHubLifetimeManagerTests.cs
index 1d413bb54b..57827e499c 100644
--- a/src/SignalR/server/StackExchangeRedis/test/RedisHubLifetimeManagerTests.cs
+++ b/src/SignalR/server/StackExchangeRedis/test/RedisHubLifetimeManagerTests.cs
@@ -7,8 +7,11 @@ using Microsoft.AspNetCore.SignalR.Protocol;
using Microsoft.AspNetCore.SignalR.Specification.Tests;
using Microsoft.AspNetCore.SignalR.Tests;
using Microsoft.AspNetCore.Testing;
+using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
+using Microsoft.Extensions.Logging.Testing;
using Microsoft.Extensions.Options;
+using Moq;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;
using Xunit;
@@ -83,6 +86,45 @@ public class RedisHubLifetimeManagerTests : ScaleoutHubLifetimeManagerTests<Test
}
}
+ [Fact]
+ public async Task ErrorFromConnectionFactoryLogsAndAllowsDisconnect()
+ {
+ var server = new TestRedisServer();
+
+ var testSink = new TestSink();
+ var logger = new TestLogger("", testSink, true);
+ var mockLoggerFactory = new Mock<ILoggerFactory>();
+ mockLoggerFactory
+ .Setup(m => m.CreateLogger(It.IsAny<string>()))
+ .Returns((string categoryName) => (ILogger)logger);
+ var loggerT = mockLoggerFactory.Object.CreateLogger<RedisHubLifetimeManager<Hub>>();
+
+ var manager = new RedisHubLifetimeManager<Hub>(
+ loggerT,
+ Options.Create(new RedisOptions()
+ {
+ ConnectionFactory = _ => throw new Exception("throw from connect")
+ }),
+ new DefaultHubProtocolResolver(new IHubProtocol[]
+ {
+ }, NullLogger<DefaultHubProtocolResolver>.Instance));
+
+ using (var client = new TestClient())
+ {
+ var connection = HubConnectionContextUtils.Create(client.Connection);
+
+ var ex = await Assert.ThrowsAsync<Exception>(() => manager.OnConnectedAsync(connection)).DefaultTimeout();
+ Assert.Equal("throw from connect", ex.Message);
+
+ await manager.OnDisconnectedAsync(connection).DefaultTimeout();
+ }
+
+ var logs = testSink.Writes.ToArray();
+ Assert.Single(logs);
+ Assert.Equal("Error connecting to Redis.", logs[0].Message);
+ Assert.Equal("throw from connect", logs[0].Exception.Message);
+ }
+
public override TestRedisServer CreateBackplane()
{
return new TestRedisServer();
diff --git a/src/submodules/googletest b/src/submodules/googletest
-Subproject 8d51dc50eb7e7698427fed81b85edad0e032112
+Subproject 0320f517fd920866d918e564105d68fd4362040