diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index 82cb6cb5bc..eb38671015 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -499,15 +499,15 @@ stages: - powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1" displayName: Setup IISExpress test certificates and schema afterBuild: - - powershell: "& ./build.ps1 -CI -NoBuild -Test /p:RunFlakyTests=true" - displayName: Run Flaky Tests + - powershell: "& ./build.ps1 -CI -NoBuild -Test /p:RunQuarantinedTests=true" + displayName: Run Quarantined Tests continueOnError: true - task: PublishTestResults@2 - displayName: Publish Flaky Test Results + displayName: Publish Quarantined Test Results inputs: testResultsFormat: 'xUnit' testResultsFiles: '*.xml' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/Flaky' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/Quarantined' artifacts: - name: Windows_Test_Dumps path: artifacts/dumps/ @@ -574,15 +574,15 @@ stages: displayName: Pack Packages (for Template tests) - bash: ./src/ProjectTemplates/build.sh --ci --pack --no-restore --no-build-deps "/bl:artifacts/log/template.pack.binlog" displayName: Pack Templates (for Template tests) - - bash: ./build.sh --no-build --ci --test -p:RunFlakyTests=true - displayName: Run Flaky Tests + - bash: ./build.sh --no-build --ci --test -p:RunQuarantinedTests=true + displayName: Run Quarantined Tests continueOnError: true - task: PublishTestResults@2 - displayName: Publish Flaky Test Results + displayName: Publish Quarantined Test Results inputs: testResultsFormat: 'xUnit' testResultsFiles: '*.xml' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/Flaky' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/Quarantined' artifacts: - name: MacOS_Test_Logs path: artifacts/log/ @@ -611,15 +611,15 @@ stages: displayName: Pack Packages (for Template tests) - bash: ./src/ProjectTemplates/build.sh --ci --pack --no-restore --no-build-deps "/bl:artifacts/log/template.pack.binlog" displayName: Pack Templates (for Template tests) - - bash: ./build.sh --no-build --ci --test -p:RunFlakyTests=true - displayName: Run Flaky Tests + - bash: ./build.sh --no-build --ci --test -p:RunQuarantinedTests=true + displayName: Run Quarantined Tests continueOnError: true - task: PublishTestResults@2 - displayName: Publish Flaky Test Results + displayName: Publish Quarantined Test Results inputs: testResultsFormat: 'xUnit' testResultsFiles: '*.xml' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/Flaky' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/Quarantined' artifacts: - name: Linux_Test_Logs path: artifacts/log/ diff --git a/Directory.Build.props b/Directory.Build.props index 3ef4008890..a2765ff560 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -35,9 +35,9 @@ true - + - + Microsoft ASP.NET Core diff --git a/docs/BuildFromSource.md b/docs/BuildFromSource.md index 5ab42b0ec7..3fc873b939 100644 --- a/docs/BuildFromSource.md +++ b/docs/BuildFromSource.md @@ -139,6 +139,11 @@ source activate.sh code . ``` +Note that if you are using the "Remote-WSL" extension in VSCode, the environment is not supplied +to the process in WSL. You can workaround this by explicitly setting the environment variables +in `~/.vscode-server/server-env-setup`. +See https://code.visualstudio.com/docs/remote/wsl#_advanced-environment-setup-script for details. + ## Building on command-line You can also build the entire project on command line with the `build.cmd`/`.sh` scripts. diff --git a/eng/FlakyTests.AfterArcade.props b/eng/FlakyTests.AfterArcade.props deleted file mode 100644 index 12f631127e..0000000000 --- a/eng/FlakyTests.AfterArcade.props +++ /dev/null @@ -1,7 +0,0 @@ - - - - $(ArtifactsDir)log\$(Configuration)\Flaky\ - $(ArtifactsDir)TestResults\$(Configuration)\Flaky\ - - diff --git a/eng/FlakyTests.BeforeArcade.props b/eng/FlakyTests.BeforeArcade.props deleted file mode 100644 index 02f9fb6c59..0000000000 --- a/eng/FlakyTests.BeforeArcade.props +++ /dev/null @@ -1,18 +0,0 @@ - - - - <_FlakyRunAdditionalArgs>-trait "Flaky:All=true" - <_NonFlakyRunAdditionalArgs>-notrait "Flaky:All=true" - - - - - <_FlakyRunAdditionalArgs>$(_FlakyRunAdditionalArgs) -trait "Flaky:AzP:All=true" -trait "Flaky:AzP:OS:$(AGENT_OS)=true" - <_NonFlakyRunAdditionalArgs>$(_NonFlakyRunAdditionalArgs) -notrait "Flaky:AzP:All=true" -notrait "Flaky:AzP:OS:$(AGENT_OS)=true" - - - - $(_NonFlakyRunAdditionalArgs) $(TestRunnerAdditionalArguments) - $(_FlakyRunAdditionalArgs) $(TestRunnerAdditionalArguments) - - diff --git a/eng/Publishing.props b/eng/Publishing.props index 47d6c9e010..74434eeea5 100644 --- a/eng/Publishing.props +++ b/eng/Publishing.props @@ -49,10 +49,12 @@ + true diff --git a/eng/QuarantinedTests.AfterArcade.props b/eng/QuarantinedTests.AfterArcade.props new file mode 100644 index 0000000000..4e0b5cde30 --- /dev/null +++ b/eng/QuarantinedTests.AfterArcade.props @@ -0,0 +1,7 @@ + + + + $(ArtifactsDir)log\$(Configuration)\Quarantined\ + $(ArtifactsDir)TestResults\$(Configuration)\Quarantined\ + + diff --git a/eng/QuarantinedTests.BeforeArcade.props b/eng/QuarantinedTests.BeforeArcade.props new file mode 100644 index 0000000000..5fa5fdcaf6 --- /dev/null +++ b/eng/QuarantinedTests.BeforeArcade.props @@ -0,0 +1,11 @@ + + + <_QuarantinedTestRunAdditionalArgs>-trait "Quarantined=true" + <_NonQuarantinedTestRunAdditionalArgs>-notrait "Quarantined=true" + + + + $(_NonQuarantinedTestRunAdditionalArgs) $(TestRunnerAdditionalArguments) + $(_QuarantinedTestRunAdditionalArgs) $(TestRunnerAdditionalArguments) + + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 2ca3900cf8..778c65dab1 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -13,348 +13,344 @@ https://github.com/dotnet/blazor dd7fb4d3931d556458f62642c2edfc59f6295bfb - + https://github.com/dotnet/aspnetcore-tooling - 151c6a416f147c687c61dcb9b8cf3f6bd0c1a79f + 33a9f3ca20e57e7fb69fd90b9aa9b2278f377a54 - + https://github.com/dotnet/aspnetcore-tooling - 151c6a416f147c687c61dcb9b8cf3f6bd0c1a79f + 33a9f3ca20e57e7fb69fd90b9aa9b2278f377a54 - + https://github.com/dotnet/aspnetcore-tooling - 151c6a416f147c687c61dcb9b8cf3f6bd0c1a79f + 33a9f3ca20e57e7fb69fd90b9aa9b2278f377a54 - + https://github.com/dotnet/aspnetcore-tooling - 151c6a416f147c687c61dcb9b8cf3f6bd0c1a79f + 33a9f3ca20e57e7fb69fd90b9aa9b2278f377a54 - + https://github.com/dotnet/efcore - ca43ad17d612518231cc6b8a359e7168de1f76f1 + 39633487003879903958dc09be5bb4ec6d6034df - + https://github.com/dotnet/efcore - ca43ad17d612518231cc6b8a359e7168de1f76f1 + 39633487003879903958dc09be5bb4ec6d6034df - + https://github.com/dotnet/efcore - ca43ad17d612518231cc6b8a359e7168de1f76f1 + 39633487003879903958dc09be5bb4ec6d6034df - + https://github.com/dotnet/efcore - ca43ad17d612518231cc6b8a359e7168de1f76f1 + 39633487003879903958dc09be5bb4ec6d6034df - + https://github.com/dotnet/efcore - ca43ad17d612518231cc6b8a359e7168de1f76f1 + 39633487003879903958dc09be5bb4ec6d6034df - + https://github.com/dotnet/efcore - ca43ad17d612518231cc6b8a359e7168de1f76f1 + 39633487003879903958dc09be5bb4ec6d6034df - + https://github.com/dotnet/efcore - ca43ad17d612518231cc6b8a359e7168de1f76f1 + 39633487003879903958dc09be5bb4ec6d6034df - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/arcade - 85d76351b1f0245c9f331f72219d12e8e2d48e72 + 8ccad075bbb0db445e03eed0a6073d27bdd4f31a - + https://github.com/dotnet/arcade - 85d76351b1f0245c9f331f72219d12e8e2d48e72 + 8ccad075bbb0db445e03eed0a6073d27bdd4f31a - + https://github.com/dotnet/arcade - 85d76351b1f0245c9f331f72219d12e8e2d48e72 + 8ccad075bbb0db445e03eed0a6073d27bdd4f31a - - https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 - - + https://github.com/dotnet/roslyn - 1baa0b3063238ed752ad1f0368b1df6b6901373e + 20b9af913f1b8ce0a62f72bea9e75e4aa3cf6b0e diff --git a/eng/Versions.props b/eng/Versions.props index cb3157e855..32a5384560 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -62,97 +62,96 @@ --> - 5.0.0-beta.20123.1 + 5.0.0-beta.20151.1 - 3.5.0-beta4-20125-04 + 3.5.0-beta4-20153-05 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 2.1.0-preview.2.20125.16 + 5.0.0-preview.2-runtime.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 2.1.0-preview.2.20154.1 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 - 5.0.0-preview.2.20125.16 + 5.0.0-preview.2.20154.1 3.2.0-preview1.20067.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-dev - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 + 5.0.0-preview.2.20154.4 + 5.0.0-preview.2.20154.4 + 5.0.0-preview.2.20154.4 + 5.0.0-preview.2.20154.4 + 5.0.0-preview.2.20154.4 + 5.0.0-preview.2.20154.4 + 5.0.0-preview.2.20154.4 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 0.9.9 - 0.10.13 + 0.12.0 4.2.1 4.2.1 3.8.0 diff --git a/eng/common/dotnet-install.sh b/eng/common/dotnet-install.sh index 50bc5e475c..ead6a1d9a2 100755 --- a/eng/common/dotnet-install.sh +++ b/eng/common/dotnet-install.sh @@ -63,7 +63,7 @@ case $cpuname in amd64|x86_64) buildarch=x64 ;; - armv7l) + armv*l) buildarch=arm ;; i686) diff --git a/eng/common/init-tools-native.sh b/eng/common/init-tools-native.sh index dbd7cbfdf6..29fc5db8ae 100755 --- a/eng/common/init-tools-native.sh +++ b/eng/common/init-tools-native.sh @@ -34,6 +34,14 @@ while (($# > 0)); do force=true shift 1 ;; + --donotabortonfailure) + donotabortonfailure=true + shift 1 + ;; + --donotdisplaywarnings) + donotdisplaywarnings=true + shift 1 + ;; --downloadretries) download_retries=$2 shift 2 @@ -52,6 +60,8 @@ while (($# > 0)); do echo " - (default) %USERPROFILE%/.netcoreeng/native" echo "" echo " --clean Switch specifying not to install anything, but cleanup native asset folders" + echo " --donotabortonfailure Switch specifiying whether to abort native tools installation on failure" + echo " --donotdisplaywarnings Switch specifiying whether to display warnings during native tools installation on failure" echo " --force Clean and then install tools" echo " --help Print help and exit" echo "" @@ -92,6 +102,7 @@ if [[ -z $install_directory ]]; then fi install_bin="${native_base_dir}/bin" +installed_any=false ReadGlobalJsonNativeTools @@ -103,8 +114,8 @@ else for tool in "${!native_assets[@]}" do tool_version=${native_assets[$tool]} - installer_name="install-$tool.sh" - installer_command="$native_installer_dir/$installer_name" + installer_path="$native_installer_dir/install-$tool.sh" + installer_command="$installer_path" installer_command+=" --baseuri $base_uri" installer_command+=" --installpath $install_bin" installer_command+=" --version $tool_version" @@ -118,11 +129,29 @@ else installer_command+=" --clean" fi - $installer_command - - if [[ $? != 0 ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed" - exit 1 + if [[ -a $installer_path ]]; then + $installer_command + if [[ $? != 0 ]]; then + if [[ $donotabortonfailure = true ]]; then + if [[ $donotdisplaywarnings != true ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed" + fi + else + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed" + exit 1 + fi + else + $installed_any = true + fi + else + if [[ $donotabortonfailure == true ]]; then + if [[ $donotdisplaywarnings != true ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed: no install script" + fi + else + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed: no install script" + exit 1 + fi fi done fi @@ -135,8 +164,10 @@ if [[ -d $install_bin ]]; then echo "Native tools are available from $install_bin" echo "##vso[task.prependpath]$install_bin" else - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Native tools install directory does not exist, installation failed" - exit 1 + if [[ $installed_any = true ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Native tools install directory does not exist, installation failed" + exit 1 + fi fi exit 0 diff --git a/eng/common/performance/perfhelixpublish.proj b/eng/common/performance/perfhelixpublish.proj index e5826b5323..cf5941e1b6 100644 --- a/eng/common/performance/perfhelixpublish.proj +++ b/eng/common/performance/perfhelixpublish.proj @@ -6,7 +6,7 @@ py -3 %HELIX_CORRELATION_PAYLOAD%\Core_Root\CoreRun.exe %HELIX_CORRELATION_PAYLOAD%\Baseline_Core_Root\CoreRun.exe - $(HelixPreCommands);call %HELIX_CORRELATION_PAYLOAD%\performance\tools\machine-setup.cmd + $(HelixPreCommands);call %HELIX_CORRELATION_PAYLOAD%\performance\tools\machine-setup.cmd;set PYTHONPATH=%HELIX_WORKITEM_PAYLOAD%\scripts%3B%HELIX_WORKITEM_PAYLOAD% %HELIX_CORRELATION_PAYLOAD%\artifacts\BenchmarkDotNet.Artifacts %HELIX_CORRELATION_PAYLOAD%\artifacts\BenchmarkDotNet.Artifacts_Baseline %HELIX_CORRELATION_PAYLOAD%\performance\src\tools\ResultsComparer\ResultsComparer.csproj @@ -99,4 +99,23 @@ 4:00 + + + + $(WorkItemDirectory)\ScenarioCorrelation + $(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name System.Private.Xml.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root + + + $(WorkItemDirectory)\ScenarioCorrelation + $(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name System.Linq.Expressions.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root + + + $(WorkItemDirectory)\ScenarioCorrelation + $(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name Microsoft.CodeAnalysis.VisualBasic.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root + + + $(WorkItemDirectory)\ScenarioCorrelation + $(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name Microsoft.CodeAnalysis.CSharp.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root + + \ No newline at end of file diff --git a/eng/common/templates/post-build/channels/generic-internal-channel.yml b/eng/common/templates/post-build/channels/generic-internal-channel.yml index 380122901d..dde27800c3 100644 --- a/eng/common/templates/post-build/channels/generic-internal-channel.yml +++ b/eng/common/templates/post-build/channels/generic-internal-channel.yml @@ -84,6 +84,7 @@ stages: - job: publish_assets displayName: Publish Assets dependsOn: setupMaestroVars + timeoutInMinutes: 120 variables: - name: BARBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] diff --git a/eng/common/templates/post-build/channels/generic-public-channel.yml b/eng/common/templates/post-build/channels/generic-public-channel.yml index 00ef36fefe..29bc1a941a 100644 --- a/eng/common/templates/post-build/channels/generic-public-channel.yml +++ b/eng/common/templates/post-build/channels/generic-public-channel.yml @@ -83,6 +83,7 @@ stages: - job: publish_assets displayName: Publish Assets dependsOn: setupMaestroVars + timeoutInMinutes: 120 variables: - name: BARBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] diff --git a/eng/helix/content/runtests.cmd b/eng/helix/content/runtests.cmd index 73cf658c18..5fe1af7eb6 100644 --- a/eng/helix/content/runtests.cmd +++ b/eng/helix/content/runtests.cmd @@ -53,23 +53,21 @@ if %$quarantined%==True ( set %$quarantined=true ) -set NONQUARANTINE_FILTER="Flaky:All!=true&Flaky:Helix:All!=true&Flaky:Helix:Queue:All!=true&Flaky:Helix:Queue:%HELIX%!=true" -set QUARANTINE_FILTER="Flaky:All=true|Flaky:Helix:All=true|Flaky:Helix:Queue:All=true|Flaky:Helix:Queue:%HELIX%=true" +set NONQUARANTINE_FILTER="Quarantined!=true" +set QUARANTINE_FILTER="Quarantined=true" if %$quarantined%==true ( echo Running quarantined tests. %DOTNET_ROOT%\dotnet vstest %$target% --logger:xunit --TestCaseFilter:%QUARANTINE_FILTER% if errorlevel 1 ( - echo Failure in flaky test 1>&2 + echo Failure in quarantined test 1>&2 REM DO NOT EXIT and DO NOT SET EXIT_CODE to 1 ) ) else ( - REM We need to specify all possible Flaky filters that apply to this environment, because the flaky attribute - REM only puts the explicit filter traits the user provided in REM Filter syntax: https://github.com/Microsoft/vstest-docs/blob/master/docs/filter.md echo Running non-quarantined tests. %DOTNET_ROOT%\dotnet vstest %$target% --logger:xunit --TestCaseFilter:%NONQUARANTINE_FILTER% if errorlevel 1 ( - echo Failure in non-flaky test 1>&2 + echo Failure in non-quarantined test 1>&2 set exit_code=1 REM DO NOT EXIT ) diff --git a/eng/helix/content/runtests.sh b/eng/helix/content/runtests.sh index c31297d587..7d319e0a38 100644 --- a/eng/helix/content/runtests.sh +++ b/eng/helix/content/runtests.sh @@ -115,11 +115,9 @@ fi exit_code=0 -# We need to specify all possible quarantined filters that apply to this environment, because the quarantine attribute -# only puts the explicit filter traits the user provided in the flaky attribute # Filter syntax: https://github.com/Microsoft/vstest-docs/blob/master/docs/filter.md -NONQUARANTINE_FILTER="Flaky:All!=true&Flaky:Helix:All!=true&Flaky:Helix:Queue:All!=true&Flaky:Helix:Queue:$helix_queue_name!=true" -QUARANTINE_FILTER="Flaky:All=true|Flaky:Helix:All=true|Flaky:Helix:Queue:All=true|Flaky:Helix:Queue:$helix_queue_name=true" +NONQUARANTINE_FILTER="Quarantined!=true" +QUARANTINE_FILTER="Quarantined=true" if [ "$quarantined" == true ]; then echo "Running all tests including quarantined." $DOTNET_ROOT/dotnet vstest $test_binary_path --logger:xunit --TestCaseFilter:"$QUARANTINE_FILTER" diff --git a/global.json b/global.json index 9d9a073328..15a1a6543e 100644 --- a/global.json +++ b/global.json @@ -25,7 +25,7 @@ }, "msbuild-sdks": { "Yarn.MSBuild": "1.15.2", - "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20123.1", - "Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20123.1" + "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20151.1", + "Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20151.1" } } diff --git a/src/Components/Components/ref/Microsoft.AspNetCore.Components.netcoreapp.cs b/src/Components/Components/ref/Microsoft.AspNetCore.Components.netcoreapp.cs index 10a26b70af..17c4d7a4f5 100644 --- a/src/Components/Components/ref/Microsoft.AspNetCore.Components.netcoreapp.cs +++ b/src/Components/Components/ref/Microsoft.AspNetCore.Components.netcoreapp.cs @@ -12,6 +12,7 @@ namespace Microsoft.AspNetCore.Components public static string FormatValue(System.DateTimeOffset value, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(decimal value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(double value, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(short value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(int value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(long value, System.Globalization.CultureInfo culture = null) { throw null; } public static bool? FormatValue(bool? value, System.Globalization.CultureInfo culture = null) { throw null; } @@ -21,6 +22,7 @@ namespace Microsoft.AspNetCore.Components public static string FormatValue(System.DateTime? value, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(decimal? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(double? value, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(short? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(int? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(long? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(float? value, System.Globalization.CultureInfo culture = null) { throw null; } @@ -47,6 +49,8 @@ namespace Microsoft.AspNetCore.Components public static bool TryConvertToNullableFloat(object obj, System.Globalization.CultureInfo culture, out float? value) { throw null; } public static bool TryConvertToNullableInt(object obj, System.Globalization.CultureInfo culture, out int? value) { throw null; } public static bool TryConvertToNullableLong(object obj, System.Globalization.CultureInfo culture, out long? value) { throw null; } + public static bool TryConvertToNullableShort(object obj, System.Globalization.CultureInfo culture, out short? value) { throw null; } + public static bool TryConvertToShort(object obj, System.Globalization.CultureInfo culture, out short value) { throw null; } public static bool TryConvertToString(object obj, System.Globalization.CultureInfo culture, out string value) { throw null; } public static bool TryConvertTo(object obj, System.Globalization.CultureInfo culture, out T value) { throw null; } } @@ -165,6 +169,7 @@ namespace Microsoft.AspNetCore.Components public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, System.DateTime existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, decimal existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, double existingValue, System.Globalization.CultureInfo culture = null) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, short existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, int existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, long existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, bool? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } @@ -174,6 +179,7 @@ namespace Microsoft.AspNetCore.Components public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, System.DateTime? existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, decimal? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, double? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, short? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, int? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, long? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, float? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } diff --git a/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.cs b/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.cs index 10a26b70af..17c4d7a4f5 100644 --- a/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.cs +++ b/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.cs @@ -12,6 +12,7 @@ namespace Microsoft.AspNetCore.Components public static string FormatValue(System.DateTimeOffset value, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(decimal value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(double value, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(short value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(int value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(long value, System.Globalization.CultureInfo culture = null) { throw null; } public static bool? FormatValue(bool? value, System.Globalization.CultureInfo culture = null) { throw null; } @@ -21,6 +22,7 @@ namespace Microsoft.AspNetCore.Components public static string FormatValue(System.DateTime? value, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(decimal? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(double? value, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(short? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(int? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(long? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(float? value, System.Globalization.CultureInfo culture = null) { throw null; } @@ -47,6 +49,8 @@ namespace Microsoft.AspNetCore.Components public static bool TryConvertToNullableFloat(object obj, System.Globalization.CultureInfo culture, out float? value) { throw null; } public static bool TryConvertToNullableInt(object obj, System.Globalization.CultureInfo culture, out int? value) { throw null; } public static bool TryConvertToNullableLong(object obj, System.Globalization.CultureInfo culture, out long? value) { throw null; } + public static bool TryConvertToNullableShort(object obj, System.Globalization.CultureInfo culture, out short? value) { throw null; } + public static bool TryConvertToShort(object obj, System.Globalization.CultureInfo culture, out short value) { throw null; } public static bool TryConvertToString(object obj, System.Globalization.CultureInfo culture, out string value) { throw null; } public static bool TryConvertTo(object obj, System.Globalization.CultureInfo culture, out T value) { throw null; } } @@ -165,6 +169,7 @@ namespace Microsoft.AspNetCore.Components public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, System.DateTime existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, decimal existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, double existingValue, System.Globalization.CultureInfo culture = null) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, short existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, int existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, long existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, bool? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } @@ -174,6 +179,7 @@ namespace Microsoft.AspNetCore.Components public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, System.DateTime? existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, decimal? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, double? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, short? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, int? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, long? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, float? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } diff --git a/src/Components/Components/src/BindConverter.cs b/src/Components/Components/src/BindConverter.cs index 30ded5fe73..0aadb8077e 100644 --- a/src/Components/Components/src/BindConverter.cs +++ b/src/Components/Components/src/BindConverter.cs @@ -15,7 +15,7 @@ namespace Microsoft.AspNetCore.Components // // Perf: our conversion routines present a regular API surface that allows us to specialize on types to avoid boxing. // for instance, many of these types could be cast to IFormattable to do the appropriate formatting, but that's going - // to allocate. + // to allocate. public static class BindConverter { private static object BoxedTrue = true; @@ -158,6 +158,41 @@ namespace Microsoft.AspNetCore.Components return value.Value.ToString(culture ?? CultureInfo.CurrentCulture); } + /// + /// Formats the provided for inclusion in an attribute. + /// + /// The value to format. + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static string FormatValue(short value, CultureInfo culture = null) => FormatShortValueCore(value, culture); + + private static string FormatShortValueCore(short value, CultureInfo culture) + { + return value.ToString(culture ?? CultureInfo.CurrentCulture); + } + + /// + /// Formats the provided for inclusion in an attribute. + /// + /// The value to format. + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static string FormatValue(short? value, CultureInfo culture = null) => FormatNullableShortValueCore(value, culture); + + private static string FormatNullableShortValueCore(short? value, CultureInfo culture) + { + if (value == null) + { + return null; + } + + return value.Value.ToString(culture ?? CultureInfo.CurrentCulture); + } + /// /// Formats the provided for inclusion in an attribute. /// @@ -649,6 +684,71 @@ namespace Microsoft.AspNetCore.Components return true; } + /// + /// Attempts to convert a value to a . + /// + /// The object to convert. + /// The to use for conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToShort(object obj, CultureInfo culture, out short value) + { + return ConvertToShortCore(obj, culture, out value); + } + + /// + /// Attempts to convert a value to a nullable . + /// + /// The object to convert. + /// The to use for conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToNullableShort(object obj, CultureInfo culture, out short? value) + { + return ConvertToNullableShort(obj, culture, out value); + } + + internal static BindParser ConvertToShort = ConvertToShortCore; + internal static BindParser ConvertToNullableShort = ConvertToNullableShortCore; + + private static bool ConvertToShortCore(object obj, CultureInfo culture, out short value) + { + var text = (string)obj; + if (string.IsNullOrEmpty(text)) + { + value = default; + return false; + } + + if (!short.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) + { + value = default; + return false; + } + + value = converted; + return true; + } + + private static bool ConvertToNullableShortCore(object obj, CultureInfo culture, out short? value) + { + var text = (string)obj; + if (string.IsNullOrEmpty(text)) + { + value = default; + return true; + } + + if (!short.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) + { + value = default; + return false; + } + + value = converted; + return true; + } + /// /// Attempts to convert a value to a . /// @@ -1198,6 +1298,14 @@ namespace Microsoft.AspNetCore.Components { formatter = (BindFormatter)FormatNullableLongValueCore; } + else if (typeof(T) == typeof(short)) + { + formatter = (BindFormatter)FormatShortValueCore; + } + else if (typeof(T) == typeof(short?)) + { + formatter = (BindFormatter)FormatNullableShortValueCore; + } else if (typeof(T) == typeof(float)) { formatter = (BindFormatter)FormatFloatValueCore; @@ -1323,6 +1431,14 @@ namespace Microsoft.AspNetCore.Components { parser = ConvertToNullableLong; } + else if (typeof(T) == typeof(short)) + { + parser = ConvertToShort; + } + else if (typeof(T) == typeof(short?)) + { + parser = ConvertToNullableShort; + } else if (typeof(T) == typeof(float)) { parser = ConvertToFloat; diff --git a/src/Components/Components/src/EventCallbackFactoryBinderExtensions.cs b/src/Components/Components/src/EventCallbackFactoryBinderExtensions.cs index 2a27533dfb..0305c1b469 100644 --- a/src/Components/Components/src/EventCallbackFactoryBinderExtensions.cs +++ b/src/Components/Components/src/EventCallbackFactoryBinderExtensions.cs @@ -136,6 +136,25 @@ namespace Microsoft.AspNetCore.Components return CreateBinderCore(factory, receiver, setter, culture, ConvertToLong); } + /// + /// For internal use only. + /// + /// + /// + /// + /// + /// + /// + public static EventCallback CreateBinder( + this EventCallbackFactory factory, + object receiver, + Action setter, + short existingValue, + CultureInfo culture = null) + { + return CreateBinderCore(factory, receiver, setter, culture, ConvertToShort); + } + /// /// For internal use only. /// @@ -155,6 +174,25 @@ namespace Microsoft.AspNetCore.Components return CreateBinderCore(factory, receiver, setter, culture, ConvertToNullableLong); } + /// + /// For internal use only. + /// + /// + /// + /// + /// + /// + /// + public static EventCallback CreateBinder( + this EventCallbackFactory factory, + object receiver, + Action setter, + short? existingValue, + CultureInfo culture = null) + { + return CreateBinderCore(factory, receiver, setter, culture, ConvertToNullableShort); + } + /// /// For internal use only. /// diff --git a/src/Components/Web/src/Forms/InputNumber.cs b/src/Components/Web/src/Forms/InputNumber.cs index 09327bcae6..efdb53c905 100644 --- a/src/Components/Web/src/Forms/InputNumber.cs +++ b/src/Components/Web/src/Forms/InputNumber.cs @@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.Components.Forms { /// /// An input component for editing numeric values. - /// Supported numeric types are , , , , . + /// Supported numeric types are , , , , , . /// public class InputNumber : InputBase { @@ -22,6 +22,7 @@ namespace Microsoft.AspNetCore.Components.Forms var targetType = Nullable.GetUnderlyingType(typeof(TValue)) ?? typeof(TValue); if (targetType == typeof(int) || targetType == typeof(long) || + targetType == typeof(short) || targetType == typeof(float) || targetType == typeof(double) || targetType == typeof(decimal)) @@ -86,6 +87,9 @@ namespace Microsoft.AspNetCore.Components.Forms case long @long: return BindConverter.FormatValue(@long, CultureInfo.InvariantCulture); + case short @short: + return BindConverter.FormatValue(@short, CultureInfo.InvariantCulture); + case float @float: return BindConverter.FormatValue(@float, CultureInfo.InvariantCulture); diff --git a/src/Components/test/E2ETest/ServerExecutionTests/ComponentHubReliabilityTest.cs b/src/Components/test/E2ETest/ServerExecutionTests/ComponentHubReliabilityTest.cs index 52546042fb..774197872d 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/ComponentHubReliabilityTest.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/ComponentHubReliabilityTest.cs @@ -2,14 +2,9 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Collections.Generic; -using System.Text.Json; using System.Text.RegularExpressions; using System.Threading.Tasks; -using Ignitor; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; -using Microsoft.AspNetCore.Components.RenderTree; -using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.SignalR.Client; using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.Logging; @@ -27,6 +22,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests } [Fact] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/19414")] public async Task CannotStartMultipleCircuits() { // Arrange diff --git a/src/Components/test/E2ETest/ServerExecutionTests/GlobalizationTest.cs b/src/Components/test/E2ETest/ServerExecutionTests/GlobalizationTest.cs index 3e330f7b47..609fd83f30 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/GlobalizationTest.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/GlobalizationTest.cs @@ -186,6 +186,18 @@ namespace Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests Browser.Equal(90000000000.ToString(cultureInfo), () => display.Text); Browser.Equal(90000000000.ToString(CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + // short + input = Browser.FindElement(By.Id("inputnumber_short")); + display = Browser.FindElement(By.Id("inputnumber_short_value")); + Browser.Equal(42.ToString(cultureInfo), () => display.Text); + Browser.Equal(42.ToString(CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + + input.Clear(); + input.SendKeys(127.ToString(CultureInfo.InvariantCulture)); + input.SendKeys("\t"); + Browser.Equal(127.ToString(cultureInfo), () => display.Text); + Browser.Equal(127.ToString(CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + // decimal input = Browser.FindElement(By.Id("inputnumber_decimal")); display = Browser.FindElement(By.Id("inputnumber_decimal_value")); diff --git a/src/Components/test/E2ETest/ServerExecutionTests/InteropReliabilityTests.cs b/src/Components/test/E2ETest/ServerExecutionTests/InteropReliabilityTests.cs index c3e0626eb6..288b3e7c8c 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/InteropReliabilityTests.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/InteropReliabilityTests.cs @@ -11,6 +11,7 @@ using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; using Microsoft.AspNetCore.Components.RenderTree; using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.SignalR.Client; +using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.Logging; using TestServer; using Xunit; @@ -213,6 +214,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests } [Fact] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/19410")] public async Task ContinuesWorkingAfterInvalidAsyncReturnCallback() { // Arrange diff --git a/src/Components/test/E2ETest/ServerExecutionTests/ServerComponentRenderingTest.cs b/src/Components/test/E2ETest/ServerExecutionTests/ServerComponentRenderingTest.cs index 25b7b552af..de7a9321e9 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/ServerComponentRenderingTest.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/ServerComponentRenderingTest.cs @@ -6,8 +6,8 @@ using BasicTestApp; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; using Microsoft.AspNetCore.Components.E2ETest.Tests; using Microsoft.AspNetCore.E2ETesting; +using Microsoft.AspNetCore.Testing; using OpenQA.Selenium; -using OpenQA.Selenium.Support.UI; using Xunit; using Xunit.Abstractions; @@ -35,5 +35,10 @@ namespace Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests $"{typeof(InvalidOperationException).FullName}: The current thread is not associated with the Dispatcher. Use InvokeAsync() to switch execution to the Dispatcher when triggering rendering or component state.", () => result.Text); } + + [Fact] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/19413")] + public override void CanDispatchAsyncWorkToSyncContext() + => base.CanDispatchAsyncWorkToSyncContext(); } } diff --git a/src/Components/test/E2ETest/Tests/BindTest.cs b/src/Components/test/E2ETest/Tests/BindTest.cs index cefd842022..70fc700e89 100644 --- a/src/Components/test/E2ETest/Tests/BindTest.cs +++ b/src/Components/test/E2ETest/Tests/BindTest.cs @@ -355,6 +355,65 @@ namespace Microsoft.AspNetCore.Components.E2ETest.Tests Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); } + [Fact] + public void CanBindTextboxShort() + { + var target = Browser.FindElement(By.Id("textbox-short")); + var boundValue = Browser.FindElement(By.Id("textbox-short-value")); + var mirrorValue = Browser.FindElement(By.Id("textbox-short-mirror")); + Assert.Equal("-42", target.GetAttribute("value")); + Assert.Equal("-42", boundValue.Text); + Assert.Equal("-42", mirrorValue.GetAttribute("value")); + + // Clear target; value resets to zero + target.Clear(); + Browser.Equal("0", () => target.GetAttribute("value")); + Assert.Equal("0", boundValue.Text); + Assert.Equal("0", mirrorValue.GetAttribute("value")); + + // Modify target; verify value is updated and that textboxes linked to the same data are updated + // Leading zeros are not preserved + target.SendKeys("42"); + Browser.Equal("042", () => target.GetAttribute("value")); + target.SendKeys("\t"); + Browser.Equal("42", () => target.GetAttribute("value")); + Assert.Equal("42", boundValue.Text); + Assert.Equal("42", mirrorValue.GetAttribute("value")); + } + + [Fact] + public void CanBindTextboxNullableShort() + { + var target = Browser.FindElement(By.Id("textbox-nullable-short")); + var boundValue = Browser.FindElement(By.Id("textbox-nullable-short-value")); + var mirrorValue = Browser.FindElement(By.Id("textbox-nullable-short-mirror")); + Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, boundValue.Text); + Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + + // Modify target; verify value is updated and that textboxes linked to the same data are updated + target.Clear(); + Browser.Equal("", () => boundValue.Text); + Assert.Equal("", mirrorValue.GetAttribute("value")); + + // Modify target; verify value is updated and that textboxes linked to the same data are updated + target.SendKeys("-42\t"); + Browser.Equal("-42", () => boundValue.Text); + Assert.Equal("-42", mirrorValue.GetAttribute("value")); + + // Modify target; verify value is updated and that textboxes linked to the same data are updated + target.Clear(); + target.SendKeys("42\t"); + Browser.Equal("42", () => boundValue.Text); + Assert.Equal("42", mirrorValue.GetAttribute("value")); + + // Modify target; verify value is updated and that textboxes linked to the same data are updated + target.Clear(); + target.SendKeys("\t"); + Browser.Equal(string.Empty, () => boundValue.Text); + Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + } + [Fact] public void CanBindTextboxFloat() { diff --git a/src/Components/test/E2ETest/Tests/ComponentRenderingTest.cs b/src/Components/test/E2ETest/Tests/ComponentRenderingTest.cs index ca9af22c99..372995c2f5 100644 --- a/src/Components/test/E2ETest/Tests/ComponentRenderingTest.cs +++ b/src/Components/test/E2ETest/Tests/ComponentRenderingTest.cs @@ -12,6 +12,7 @@ using BasicTestApp.HierarchicalImportsTest.Subdir; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; using Microsoft.AspNetCore.E2ETesting; +using Microsoft.AspNetCore.Testing; using OpenQA.Selenium; using OpenQA.Selenium.Support.UI; using Xunit; @@ -579,7 +580,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest.Tests } [Fact] - public void CanDispatchAsyncWorkToSyncContext() + public virtual void CanDispatchAsyncWorkToSyncContext() { var appElement = Browser.MountTestComponent(); var result = appElement.FindElement(By.Id("result")); diff --git a/src/Components/test/E2ETest/Tests/EventTest.cs b/src/Components/test/E2ETest/Tests/EventTest.cs index 06dbbb969f..d2fd55b195 100644 --- a/src/Components/test/E2ETest/Tests/EventTest.cs +++ b/src/Components/test/E2ETest/Tests/EventTest.cs @@ -167,7 +167,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest.Tests } [Fact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/1987", FlakyOn.AzP.Windows)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/1987")] public void InputEvent_RespondsOnKeystrokes() { Browser.MountTestComponent(); diff --git a/src/Components/test/testassets/BasicTestApp/BindCasesComponent.razor b/src/Components/test/testassets/BasicTestApp/BindCasesComponent.razor index 45d5eacdcc..fafd59d49b 100644 --- a/src/Components/test/testassets/BasicTestApp/BindCasesComponent.razor +++ b/src/Components/test/testassets/BasicTestApp/BindCasesComponent.razor @@ -50,6 +50,18 @@ @textboxNullableLongValue

+

+ short: + + @textboxShortValue + +

+

+ Nullable short: + + @textboxNullableShortValue + +

float: @@ -328,6 +340,8 @@ int? textboxNullableIntValue = null; long textboxLongValue = 3_000_000_000; long? textboxNullableLongValue = null; + short textboxShortValue = -42; + short? textboxNullableShortValue = null; float textboxFloatValue = 3.141f; float? textboxNullableFloatValue = null; double textboxDoubleValue = 3.14159265359d; diff --git a/src/Components/test/testassets/BasicTestApp/GlobalizationBindCases.razor b/src/Components/test/testassets/BasicTestApp/GlobalizationBindCases.razor index 5294f2b1df..04b93ea0d3 100644 --- a/src/Components/test/testassets/BasicTestApp/GlobalizationBindCases.razor +++ b/src/Components/test/testassets/BasicTestApp/GlobalizationBindCases.razor @@ -66,6 +66,10 @@ long: @inputNumberLong +

+ short: + @inputNumberShort +
decimal: @inputNumberDecimal @@ -104,6 +108,7 @@ int inputNumberInt = 42; long inputNumberLong = 4200; + short inputNumberShort = 42; decimal inputNumberDecimal = 4.2m; DateTime inputDateDateTime = new DateTime(1985, 3, 4); diff --git a/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj b/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj index 70fa2ddf5b..f695e4d3ee 100644 --- a/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj +++ b/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj @@ -53,8 +53,6 @@ This package is an internal implementation of the .NET Core SDK and is not meant $(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).0 $(ReferencePackSharedFxVersion)-$(VersionSuffix) - $(PlatformManifestOutputPath) - $(RepoRoot)eng\PlatformManifest.txt @@ -157,7 +155,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant - + diff --git a/src/Hosting/Hosting/test/Internal/HostingEventSourceTests.cs b/src/Hosting/Hosting/test/Internal/HostingEventSourceTests.cs index 8aba693e21..855b6a0160 100644 --- a/src/Hosting/Hosting/test/Internal/HostingEventSourceTests.cs +++ b/src/Hosting/Hosting/test/Internal/HostingEventSourceTests.cs @@ -106,7 +106,6 @@ namespace Microsoft.AspNetCore.Hosting [Theory] [MemberData(nameof(RequestStartData))] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2230", FlakyOn.All)] public void RequestStart(DefaultHttpContext httpContext, string[] expected) { // Arrange diff --git a/src/Hosting/Hosting/test/WebHostTests.cs b/src/Hosting/Hosting/test/WebHostTests.cs index d583823113..8b7e73c5b4 100644 --- a/src/Hosting/Hosting/test/WebHostTests.cs +++ b/src/Hosting/Hosting/test/WebHostTests.cs @@ -238,7 +238,6 @@ namespace Microsoft.AspNetCore.Hosting } [ConditionalFact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2244", FlakyOn.Helix.All)] public async Task WebHostStopAsyncUsesDefaultTimeoutIfNoTokenProvided() { var data = new Dictionary diff --git a/src/Http/Headers/ref/Microsoft.Net.Http.Headers.netcoreapp.cs b/src/Http/Headers/ref/Microsoft.Net.Http.Headers.netcoreapp.cs index 41d44ad26d..74bfe68f38 100644 --- a/src/Http/Headers/ref/Microsoft.Net.Http.Headers.netcoreapp.cs +++ b/src/Http/Headers/ref/Microsoft.Net.Http.Headers.netcoreapp.cs @@ -200,6 +200,7 @@ namespace Microsoft.Net.Http.Headers public static readonly string WebSocketSubProtocols; public static readonly string WWWAuthenticate; public static readonly string XFrameOptions; + public static readonly string XRequestedWith; } public static partial class HeaderQuality { diff --git a/src/Http/Headers/src/HeaderNames.cs b/src/Http/Headers/src/HeaderNames.cs index 368cd8be46..5a30679fd8 100644 --- a/src/Http/Headers/src/HeaderNames.cs +++ b/src/Http/Headers/src/HeaderNames.cs @@ -88,5 +88,6 @@ namespace Microsoft.Net.Http.Headers public static readonly string WebSocketSubProtocols = "Sec-WebSocket-Protocol"; public static readonly string WWWAuthenticate = "WWW-Authenticate"; public static readonly string XFrameOptions = "X-Frame-Options"; + public static readonly string XRequestedWith = "X-Requested-With"; } } diff --git a/src/Identity/Extensions.Core/src/UserLoginInfo.cs b/src/Identity/Extensions.Core/src/UserLoginInfo.cs index a05a12bb43..cc2cdddf35 100644 --- a/src/Identity/Extensions.Core/src/UserLoginInfo.cs +++ b/src/Identity/Extensions.Core/src/UserLoginInfo.cs @@ -47,6 +47,9 @@ namespace Microsoft.AspNetCore.Identity /// /// The display name for the provider. /// + /// + /// Examples of the display name may be local, FACEBOOK, Google, etc. + /// public string ProviderDisplayName { get; set; } } } \ No newline at end of file diff --git a/src/Identity/test/Identity.Test/IdentityUIScriptsTest.cs b/src/Identity/test/Identity.Test/IdentityUIScriptsTest.cs index 96157ed4ea..005895f9c0 100644 --- a/src/Identity/test/Identity.Test/IdentityUIScriptsTest.cs +++ b/src/Identity/test/Identity.Test/IdentityUIScriptsTest.cs @@ -79,7 +79,7 @@ namespace Microsoft.AspNetCore.Identity.Test [Theory] [MemberData(nameof(ScriptWithFallbackSrcData))] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2267", FlakyOn.AzP.macOS)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2267")] public async Task IdentityUI_ScriptTags_FallbackSourceContent_Matches_CDNContent(ScriptTag scriptTag) { var wwwrootDir = Path.Combine(GetProjectBasePath(), "wwwroot", scriptTag.Version); diff --git a/src/Identity/test/InMemory.Test/FunctionalTest.cs b/src/Identity/test/InMemory.Test/FunctionalTest.cs index b193bc16cd..a2609b4a43 100644 --- a/src/Identity/test/InMemory.Test/FunctionalTest.cs +++ b/src/Identity/test/InMemory.Test/FunctionalTest.cs @@ -18,6 +18,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Identity.Test; using Microsoft.AspNetCore.TestHost; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Net.Http.Headers; using Xunit; namespace Microsoft.AspNetCore.Identity.InMemory @@ -425,7 +426,7 @@ namespace Microsoft.AspNetCore.Identity.InMemory } if (ajaxRequest) { - request.Headers.Add("X-Requested-With", "XMLHttpRequest"); + request.Headers.Add(HeaderNames.XRequestedWith, "XMLHttpRequest"); } var transaction = new Transaction { diff --git a/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs b/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs index c4a2c64d83..b6bb307bbe 100644 --- a/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs +++ b/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs @@ -550,7 +550,6 @@ namespace Microsoft.AspNetCore.WebSockets.Test } [Fact] - [Flaky("https://github.com/dotnet/aspnetcore/issues/8187", FlakyOn.Helix.All)] public async Task OriginIsNotValidatedForNonWebSocketRequests() { using (var server = KestrelWebSocketHelpers.CreateServer(LoggerFactory, out var port, context => diff --git a/src/Mvc/test/Mvc.FunctionalTests/TempDataInCookiesUsingCookieConsentTest.cs b/src/Mvc/test/Mvc.FunctionalTests/TempDataInCookiesUsingCookieConsentTest.cs index 14a4681180..546f862e21 100644 --- a/src/Mvc/test/Mvc.FunctionalTests/TempDataInCookiesUsingCookieConsentTest.cs +++ b/src/Mvc/test/Mvc.FunctionalTests/TempDataInCookiesUsingCookieConsentTest.cs @@ -30,7 +30,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests builder.UseStartup(); [Fact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/1803", FlakyOn.AzP.Windows)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/1803")] public async Task CookieTempDataProviderCookie_SetInResponse_OnGrantingConsent() { // Arrange @@ -64,7 +64,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests } [Fact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/1803", FlakyOn.AzP.Windows)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/1803")] public async Task CookieTempDataProviderCookie_NotSetInResponse_OnNoConsent() { // Arrange diff --git a/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/.template.config/template.json b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/.template.config/template.json index 3297878253..e49f995289 100644 --- a/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/.template.config/template.json @@ -10,7 +10,7 @@ "defaultName": "WebApplication", "description": "A project template for creating a Blazor app that runs on WebAssembly and is optionally hosted by an ASP.NET Core app. This template can be used for web apps with rich dynamic user interfaces (UIs).", "groupIdentity": "Microsoft.Web.Blazor.Wasm", - "precedence": "6001", + "precedence": "7001", "guids": [ "4C26868E-5E7C-458D-82E3-040509D0C71F", "5990939C-7E7B-4CFA-86FF-44CA5756498A", 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 8a669b652a..66bfdc777b 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 @@ -9,10 +9,10 @@ "generatorVersions": "[1.0.0.0-*)", "description": "A project template for creating a Blazor server app that runs server-side inside an ASP.NET Core app and handles user interactions over a SignalR connection. This template can be used for web apps with rich dynamic user interfaces (UIs).", "groupIdentity": "Microsoft.Web.Blazor.Server", - "precedence": "6000", - "identity": "Microsoft.Web.Blazor.Server.CSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.Web.Blazor.Server.CSharp.5.0", "shortName": "blazorserver", - "thirdPartyNotices": "https://aka.ms/aspnetcore/3.1-third-party-notices", + "thirdPartyNotices": "https://aka.ms/aspnetcore/5.0-third-party-notices", "tags": { "language": "C#", "type": "project" diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/.template.config/template.json index 08c6bb56c8..caf1ab80e6 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/.template.config/template.json @@ -9,8 +9,8 @@ "generatorVersions": "[1.0.0.0-*)", "description": "An empty project template for creating an ASP.NET Core application. This template does not have any content in it.", "groupIdentity": "Microsoft.Web.Empty", - "precedence": "6000", - "identity": "Microsoft.Web.Empty.CSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.Web.Empty.CSharp.5.0", "shortName": "web", "tags": { "language": "C#", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-FSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-FSharp/.template.config/template.json index 7c9eb6c777..df7b62a169 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-FSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-FSharp/.template.config/template.json @@ -8,8 +8,8 @@ "generatorVersions": "[1.0.0.0-*)", "description": "An empty project template for creating an ASP.NET Core application. This template does not have any content in it.", "groupIdentity": "Microsoft.Web.Empty", - "precedence": "6000", - "identity": "Microsoft.Web.Empty.FSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.Web.Empty.FSharp.5.0", "shortName": "web", "tags": { "language": "F#", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/.template.config/template.json index 0b8a573d28..0ca933164a 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/.template.config/template.json @@ -9,8 +9,8 @@ "generatorVersions": "[1.0.0.0-*)", "description": "A project template for creating a gRPC ASP.NET Core service.", "groupIdentity": "Microsoft.Web.Grpc", - "precedence": "6000", - "identity": "Microsoft.Grpc.Service.CSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.Grpc.Service.CSharp.5.0", "shortName": "grpc", "tags": { "language": "C#", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/template.json index 86a7607fa2..543e0bdd5d 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/template.json @@ -10,8 +10,8 @@ "generatorVersions": "[1.0.0.0-*)", "description": "A project for creating a Razor class library that targets .NET Standard", "groupIdentity": "Microsoft.Web.Razor", - "precedence": "6000", - "identity": "Microsoft.Web.Razor.Library.CSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.Web.Razor.Library.CSharp.5.0", "shortName": "razorclasslib", "tags": { "language": "C#", 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 2d20ad2d45..81aacfa7e7 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 @@ -10,13 +10,13 @@ "generatorVersions": "[1.0.0.0-*)", "description": "A project template for creating an ASP.NET Core application with example ASP.NET Core Razor Pages content", "groupIdentity": "Microsoft.Web.RazorPages", - "precedence": "6000", - "identity": "Microsoft.Web.RazorPages.CSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.Web.RazorPages.CSharp.5.0", "shortName": [ "webapp", "razor" ], - "thirdPartyNotices": "https://aka.ms/aspnetcore/3.1-third-party-notices", + "thirdPartyNotices": "https://aka.ms/aspnetcore/5.0-third-party-notices", "tags": { "language": "C#", "type": "project" 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 b690f80eff..d846394fa9 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 @@ -9,10 +9,10 @@ "generatorVersions": "[1.0.0.0-*)", "description": "A project template for creating an ASP.NET Core application with example ASP.NET Core MVC Views and Controllers. This template can also be used for RESTful HTTP services.", "groupIdentity": "Microsoft.Web.Mvc", - "precedence": "6000", - "identity": "Microsoft.Web.Mvc.CSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.Web.Mvc.CSharp.5.0", "shortName": "mvc", - "thirdPartyNotices": "https://aka.ms/aspnetcore/3.1-third-party-notices", + "thirdPartyNotices": "https://aka.ms/aspnetcore/5.0-third-party-notices", "tags": { "language": "C#", "type": "project" diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/.template.config/template.json index 487cdfc527..779cf7d82c 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/.template.config/template.json @@ -9,10 +9,10 @@ "generatorVersions": "[1.0.0.0-*)", "description": "A project template for creating an ASP.NET Core application with example ASP.NET Core MVC Views and Controllers. This template can also be used for RESTful HTTP services.", "groupIdentity": "Microsoft.Web.Mvc", - "precedence": "6000", - "identity": "Microsoft.Web.Mvc.FSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.Web.Mvc.FSharp.5.0", "shortName": "mvc", - "thirdPartyNotices": "https://aka.ms/aspnetcore/3.1-third-party-notices", + "thirdPartyNotices": "https://aka.ms/aspnetcore/5.0-third-party-notices", "tags": { "language": "F#", "type": "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 2de35fc292..9c560017be 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 @@ -9,8 +9,8 @@ "generatorVersions": "[1.0.0.0-*)", "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.", "groupIdentity": "Microsoft.Web.WebApi", - "precedence": "6000", - "identity": "Microsoft.Web.WebApi.CSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.Web.WebApi.CSharp.5.0", "shortName": "webapi", "tags": { "language": "C#", 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 e1639b58b9..b3f4e81300 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 @@ -8,8 +8,8 @@ "generatorVersions": "[1.0.0.0-*)", "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.", "groupIdentity": "Microsoft.Web.WebApi", - "precedence": "6000", - "identity": "Microsoft.Web.WebApi.FSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.Web.WebApi.FSharp.5.0", "shortName": "webapi", "tags": { "language": "F#", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Worker-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/Worker-CSharp/.template.config/template.json index 16156aef0d..fa3775c564 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Worker-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/Worker-CSharp/.template.config/template.json @@ -10,8 +10,8 @@ "generatorVersions": "[1.0.0.0-*)", "description": "An empty project template for creating a worker service.", "groupIdentity": "Microsoft.Worker.Empty", - "precedence": "6000", - "identity": "Microsoft.Worker.Empty.CSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.Worker.Empty.CSharp.5.0", "shortName": "worker", "tags": { "language": "C#", diff --git a/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/Angular-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/Angular-CSharp/.template.config/template.json index f0162aa616..fb376267c2 100644 --- a/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/Angular-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/Angular-CSharp/.template.config/template.json @@ -6,8 +6,8 @@ "SPA" ], "groupIdentity": "Microsoft.DotNet.Web.Spa.ProjectTemplates.Angular", - "precedence": "6000", - "identity": "Microsoft.DotNet.Web.Spa.ProjectTemplates.Angular.CSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.DotNet.Web.Spa.ProjectTemplates.Angular.CSharp.5.0", "name": "ASP.NET Core with Angular", "preferNameDirectory": true, "primaryOutputs": [ diff --git a/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/React-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/React-CSharp/.template.config/template.json index 6490d8e061..4b2e6ad786 100644 --- a/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/React-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/React-CSharp/.template.config/template.json @@ -6,8 +6,8 @@ "SPA" ], "groupIdentity": "Microsoft.DotNet.Web.Spa.ProjectTemplates.React", - "precedence": "6000", - "identity": "Microsoft.DotNet.Web.Spa.ProjectTemplates.React.CSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.DotNet.Web.Spa.ProjectTemplates.React.CSharp.5.0", "name": "ASP.NET Core with React.js", "preferNameDirectory": true, "primaryOutputs": [ diff --git a/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/.template.config/template.json index 0f2945d10f..f32b4adac4 100644 --- a/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/.template.config/template.json @@ -6,8 +6,8 @@ "SPA" ], "groupIdentity": "Microsoft.DotNet.Web.Spa.ProjectTemplates.ReactRedux", - "precedence": "6000", - "identity": "Microsoft.DotNet.Web.Spa.ProjectTemplates.ReactRedux.CSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.DotNet.Web.Spa.ProjectTemplates.ReactRedux.CSharp.5.0", "name": "ASP.NET Core with React.js and Redux", "preferNameDirectory": true, "primaryOutputs": [ diff --git a/src/ProjectTemplates/test/SpaTemplateTest/ReactTemplateTest.cs b/src/ProjectTemplates/test/SpaTemplateTest/ReactTemplateTest.cs index a2e1c1c368..9e591ff67d 100644 --- a/src/ProjectTemplates/test/SpaTemplateTest/ReactTemplateTest.cs +++ b/src/ProjectTemplates/test/SpaTemplateTest/ReactTemplateTest.cs @@ -22,6 +22,7 @@ namespace Templates.Test.SpaTemplateTest public Task ReactTemplate_Works_NetCore() => SpaTemplateImplAsync("reactnoauth", "react", useLocalDb: false, usesAuth: false); + [QuarantinedTest] [ConditionalFact] [SkipOnHelix("selenium")] public Task ReactTemplate_IndividualAuth_NetCore() diff --git a/src/Security/Authentication/Cookies/src/CookieAuthenticationEvents.cs b/src/Security/Authentication/Cookies/src/CookieAuthenticationEvents.cs index a6bb4e7d1c..a751c3eb53 100644 --- a/src/Security/Authentication/Cookies/src/CookieAuthenticationEvents.cs +++ b/src/Security/Authentication/Cookies/src/CookieAuthenticationEvents.cs @@ -9,7 +9,7 @@ using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.Authentication.Cookies { /// - /// This default implementation of the ICookieAuthenticationEvents may be used if the + /// This default implementation of the ICookieAuthenticationEvents may be used if the /// application only needs to override a few of the interface methods. This may be used as a base class /// or may be instantiated directly. /// @@ -103,9 +103,9 @@ namespace Microsoft.AspNetCore.Authentication.Cookies private static bool IsAjaxRequest(HttpRequest request) { - return string.Equals(request.Query["X-Requested-With"], "XMLHttpRequest", StringComparison.Ordinal) || - string.Equals(request.Headers["X-Requested-With"], "XMLHttpRequest", StringComparison.Ordinal); - } + return string.Equals(request.Query[HeaderNames.XRequestedWith], "XMLHttpRequest", StringComparison.Ordinal) || + string.Equals(request.Headers[HeaderNames.XRequestedWith], "XMLHttpRequest", StringComparison.Ordinal); + } /// /// Implements the interface method by invoking the related delegate method. diff --git a/src/Security/Authentication/Negotiate/test/Negotiate.Test/EventTests.cs b/src/Security/Authentication/Negotiate/test/Negotiate.Test/EventTests.cs index 5ad64494b1..bc18f861b5 100644 --- a/src/Security/Authentication/Negotiate/test/Negotiate.Test/EventTests.cs +++ b/src/Security/Authentication/Negotiate/test/Negotiate.Test/EventTests.cs @@ -13,6 +13,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.TestHost; +using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Net.Http.Headers; @@ -20,6 +21,7 @@ using Xunit; namespace Microsoft.AspNetCore.Authentication.Negotiate { + [QuarantinedTest] public class EventTests { [Fact] diff --git a/src/Security/Authentication/Negotiate/test/Negotiate.Test/Microsoft.AspNetCore.Authentication.Negotiate.Test.csproj b/src/Security/Authentication/Negotiate/test/Negotiate.Test/Microsoft.AspNetCore.Authentication.Negotiate.Test.csproj index 7af38dfa4a..3f483fc9e1 100644 --- a/src/Security/Authentication/Negotiate/test/Negotiate.Test/Microsoft.AspNetCore.Authentication.Negotiate.Test.csproj +++ b/src/Security/Authentication/Negotiate/test/Negotiate.Test/Microsoft.AspNetCore.Authentication.Negotiate.Test.csproj @@ -12,6 +12,7 @@ + diff --git a/src/Security/Authentication/Negotiate/test/Negotiate.Test/NegotiateHandlerTests.cs b/src/Security/Authentication/Negotiate/test/Negotiate.Test/NegotiateHandlerTests.cs index be6593e543..89685b286b 100644 --- a/src/Security/Authentication/Negotiate/test/Negotiate.Test/NegotiateHandlerTests.cs +++ b/src/Security/Authentication/Negotiate/test/Negotiate.Test/NegotiateHandlerTests.cs @@ -13,6 +13,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.TestHost; +using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Net.Http.Headers; @@ -21,6 +22,7 @@ using Xunit.Sdk; namespace Microsoft.AspNetCore.Authentication.Negotiate { + [QuarantinedTest] public class NegotiateHandlerTests { [Fact] diff --git a/src/Security/Authentication/Negotiate/test/Negotiate.Test/ServerDeferralTests.cs b/src/Security/Authentication/Negotiate/test/Negotiate.Test/ServerDeferralTests.cs index eba5c12fea..e5cf8ca7b6 100644 --- a/src/Security/Authentication/Negotiate/test/Negotiate.Test/ServerDeferralTests.cs +++ b/src/Security/Authentication/Negotiate/test/Negotiate.Test/ServerDeferralTests.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting.Server; using Microsoft.AspNetCore.TestHost; +using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Options; @@ -14,6 +15,7 @@ using Xunit; namespace Microsoft.AspNetCore.Authentication.Negotiate { + [QuarantinedTest] public class ServerDeferralTests { [Fact] diff --git a/src/Servers/HttpSys/test/FunctionalTests/Listener/RequestBodyTests.cs b/src/Servers/HttpSys/test/FunctionalTests/Listener/RequestBodyTests.cs index 2f0308af9b..8e2860cf69 100644 --- a/src/Servers/HttpSys/test/FunctionalTests/Listener/RequestBodyTests.cs +++ b/src/Servers/HttpSys/test/FunctionalTests/Listener/RequestBodyTests.cs @@ -17,7 +17,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener public class RequestBodyTests { [ConditionalFact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/1826", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/1826")] public async Task RequestBody_SyncReadDisabledByDefault_WorksWhenEnabled() { string address; @@ -142,7 +142,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener } [ConditionalFact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2206", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2206")] public async Task RequestBody_ReadAsyncPartialBodyAndExpiredTimeout_Canceled() { StaggardContent content = new StaggardContent(); diff --git a/src/Servers/HttpSys/test/FunctionalTests/ResponseCachingTests.cs b/src/Servers/HttpSys/test/FunctionalTests/ResponseCachingTests.cs index 2c45b352e3..1112420ed6 100644 --- a/src/Servers/HttpSys/test/FunctionalTests/ResponseCachingTests.cs +++ b/src/Servers/HttpSys/test/FunctionalTests/ResponseCachingTests.cs @@ -45,7 +45,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.FunctionalTests } [ConditionalFact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2135", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2135")] public async Task Caching_JustPublic_NotCached() { var requestCount = 1; @@ -86,7 +86,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.FunctionalTests } [ConditionalFact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2207", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2207")] public async Task Caching_WithoutContentType_Cached_OnWin7AndWin2008R2() { if (Utilities.IsWin8orLater) @@ -237,7 +237,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.FunctionalTests [ConditionalTheory] [InlineData("0")] [InlineData("-1")] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2208", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2208")] public async Task Caching_InvalidExpires_NotCached(string expiresValue) { var requestCount = 1; @@ -378,7 +378,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.FunctionalTests } [ConditionalFact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2209", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2209")] public async Task Caching_VariousStatusCodes_Cached() { var requestCount = 1; diff --git a/src/Servers/HttpSys/test/FunctionalTests/ServerTests.cs b/src/Servers/HttpSys/test/FunctionalTests/ServerTests.cs index bf266025b4..fbea889de4 100644 --- a/src/Servers/HttpSys/test/FunctionalTests/ServerTests.cs +++ b/src/Servers/HttpSys/test/FunctionalTests/ServerTests.cs @@ -131,7 +131,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys } [ConditionalFact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2267", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2267")] public async Task Server_ShutdownDuringRequest_Success() { Task responseTask; diff --git a/src/Servers/IIS/AspNetCoreModuleV2/CommonLibTests/CommonLibTests.vcxproj b/src/Servers/IIS/AspNetCoreModuleV2/CommonLibTests/CommonLibTests.vcxproj index a49803ecce..9f24c25f67 100644 --- a/src/Servers/IIS/AspNetCoreModuleV2/CommonLibTests/CommonLibTests.vcxproj +++ b/src/Servers/IIS/AspNetCoreModuleV2/CommonLibTests/CommonLibTests.vcxproj @@ -98,6 +98,7 @@ EnableFastChecks MultiThreadedDebug Level3 + true $(MSBuildThisFileDirectory)include;%(AdditionalIncludeDirectories);..\RequestHandlerLib;..\IISLib;..\CommonLib;$(GoogleTestSubmoduleRoot)googletest\include;$(GoogleTestSubmoduleRoot)googlemock\include;...\AspNetCore\Inc;..\InProcessRequestHandler\ /D "_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING" stdcpp17 @@ -125,6 +126,7 @@ EnableFastChecks MultiThreadedDebug Level3 + true $(MSBuildThisFileDirectory)include;%(AdditionalIncludeDirectories);..\RequestHandlerLib;..\IISLib;..\CommonLib;$(GoogleTestSubmoduleRoot)googletest\include;$(GoogleTestSubmoduleRoot)googlemock\include;...\AspNetCore\Inc;..\InProcessRequestHandler\ /D "_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING" stdcpp17 @@ -150,6 +152,7 @@ stdafx.h MultiThreaded Level3 + true ProgramDatabase $(MSBuildThisFileDirectory)include;%(AdditionalIncludeDirectories);..\RequestHandlerLib;..\IISLib;..\CommonLib;$(GoogleTestSubmoduleRoot)googletest\include;$(GoogleTestSubmoduleRoot)googlemock\include;...\AspNetCore\Inc;..\InProcessRequestHandler\ /D "_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING" @@ -179,6 +182,7 @@ stdafx.h MultiThreaded Level3 + true ProgramDatabase $(MSBuildThisFileDirectory)include;%(AdditionalIncludeDirectories);..\RequestHandlerLib;..\IISLib;..\CommonLib;$(GoogleTestSubmoduleRoot)googletest\include;$(GoogleTestSubmoduleRoot)googlemock\include;...\AspNetCore\Inc;..\InProcessRequestHandler\ /D "_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING" @@ -200,4 +204,4 @@ - \ No newline at end of file + diff --git a/src/Servers/IIS/AspNetCoreModuleV2/CommonLibTests/dotnet_exe_path_tests.cpp b/src/Servers/IIS/AspNetCoreModuleV2/CommonLibTests/dotnet_exe_path_tests.cpp index 1d767accde..b7b334059a 100644 --- a/src/Servers/IIS/AspNetCoreModuleV2/CommonLibTests/dotnet_exe_path_tests.cpp +++ b/src/Servers/IIS/AspNetCoreModuleV2/CommonLibTests/dotnet_exe_path_tests.cpp @@ -16,7 +16,6 @@ namespace InprocessTests TEST(Dotnet_EXE_Path_Tests, EndWith_dotnet) { - HostFxrResolver resolver; std::filesystem::path hostFxrDllPath; std::vector arguments; ErrorContext errorContext; diff --git a/src/Servers/IIS/IIS/benchmarks/IIS.Performance/FirstRequestConfig.cs b/src/Servers/IIS/IIS/benchmarks/IIS.Performance/FirstRequestConfig.cs index 727746871f..c048b28f8d 100644 --- a/src/Servers/IIS/IIS/benchmarks/IIS.Performance/FirstRequestConfig.cs +++ b/src/Servers/IIS/IIS/benchmarks/IIS.Performance/FirstRequestConfig.cs @@ -27,10 +27,10 @@ namespace BenchmarkDotNet.Attributes Add(JitOptimizationsValidator.FailOnError); - Add(Job.Core + Add(Job.Default .With(CsProjCoreToolchain.From(NetCoreAppSettings.NetCoreApp21)) .With(new GcMode { Server = true }) - .WithTargetCount(10) + .WithIterationCount(10) .WithInvocationCount(1) .WithUnrollFactor(1) .With(RunStrategy.ColdStart)); diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/AppOfflineTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/AppOfflineTests.cs index 13409c545d..89c44e719f 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/AppOfflineTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/AppOfflineTests.cs @@ -211,7 +211,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests [ConditionalTheory] [InlineData(HostingModel.InProcess)] [InlineData(HostingModel.OutOfProcess)] - [Flaky("https://github.com/dotnet/aspnetcore/issues/7075", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/7075")] public async Task AppOfflineAddedAndRemovedStress(HostingModel hostingModel) { var deploymentResult = await AssertStarts(hostingModel); diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/ConfigurationChangeTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/ConfigurationChangeTests.cs index 92f581b156..66ffde7f20 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/ConfigurationChangeTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/ConfigurationChangeTests.cs @@ -79,7 +79,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests [ConditionalTheory] [InlineData(HostingModel.InProcess)] [InlineData(HostingModel.OutOfProcess)] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/1794", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/1794")] public async Task ConfigurationTouchedStress(HostingModel hostingModel) { var deploymentResult = await DeployAsync(Fixture.GetBaseDeploymentParameters(hostingModel)); diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/FrebTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/FrebTests.cs index 68c1762048..7573fc021d 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/FrebTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/FrebTests.cs @@ -80,7 +80,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess // I think this test is flaky due to freb file not being created quickly enough. // Adding extra logging, marking as flaky, and repeating should help [ConditionalFact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2570", FlakyOn.Helix.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2570")] [Repeat(10)] [RequiresIIS(IISCapability.FailedRequestTracingModule)] public async Task CheckFrebDisconnect() diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/SynchronousReadAndWriteTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/SynchronousReadAndWriteTests.cs index 72fcdeefd5..e896acc67c 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/SynchronousReadAndWriteTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/SynchronousReadAndWriteTests.cs @@ -22,7 +22,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess } [ConditionalFact] - [Flaky("https://github.com/dotnet/aspnetcore/issues/7341", FlakyOn.Helix.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/7341")] public async Task ReadAndWriteSynchronously() { for (int i = 0; i < 100; i++) diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/LogFileTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/LogFileTests.cs index 6a15e6f4b3..0a60187315 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/LogFileTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/LogFileTests.cs @@ -171,7 +171,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests [ConditionalTheory] [MemberData(nameof(TestVariants))] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2200", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2200")] public async Task CheckUTF8File(TestVariant variant) { var path = "CheckConsoleFunctions"; diff --git a/src/Servers/IIS/IIS/test/IIS.Tests/ClientDisconnectTests.cs b/src/Servers/IIS/IIS/test/IIS.Tests/ClientDisconnectTests.cs index 5fe5d75a87..354b8a2229 100644 --- a/src/Servers/IIS/IIS/test/IIS.Tests/ClientDisconnectTests.cs +++ b/src/Servers/IIS/IIS/test/IIS.Tests/ClientDisconnectTests.cs @@ -225,7 +225,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests } [ConditionalFact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/1817", FlakyOn.AzP.Windows)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/1817")] public async Task ReaderThrowsResetExceptionOnInvalidBody() { var requestStartedCompletionSource = CreateTaskCompletionSource(); 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 fff909e41c..516d7c32ec 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http/HttpHeaders.Generated.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http/HttpHeaders.Generated.cs @@ -14,6 +14,81 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { + internal enum KnownHeaderType + { + Unknown, + Accept, + AcceptCharset, + AcceptEncoding, + AcceptLanguage, + AcceptRanges, + AccessControlAllowCredentials, + AccessControlAllowHeaders, + AccessControlAllowMethods, + AccessControlAllowOrigin, + AccessControlExposeHeaders, + AccessControlMaxAge, + AccessControlRequestHeaders, + AccessControlRequestMethod, + Age, + Allow, + AltSvc, + Authority, + Authorization, + CacheControl, + Connection, + ContentEncoding, + ContentLanguage, + ContentLength, + ContentLocation, + ContentMD5, + ContentRange, + ContentType, + Cookie, + CorrelationContext, + Date, + DNT, + ETag, + Expect, + Expires, + From, + Host, + IfMatch, + IfModifiedSince, + IfNoneMatch, + IfRange, + IfUnmodifiedSince, + KeepAlive, + LastModified, + Location, + MaxForwards, + Method, + Origin, + Path, + Pragma, + ProxyAuthenticate, + ProxyAuthorization, + Range, + Referer, + RequestId, + RetryAfter, + Scheme, + Server, + SetCookie, + TE, + TraceParent, + TraceState, + Trailer, + TransferEncoding, + Translate, + Upgrade, + UpgradeInsecureRequests, + UserAgent, + Vary, + Via, + Warning, + WWWAuthenticate, + } internal partial class HttpRequestHeaders { @@ -347,12 +422,80 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http _headers._LastModified = value; } } - public StringValues HeaderAccept + public StringValues HeaderAuthority { get { StringValues value = default; if ((_bits & 0x80000L) != 0) + { + value = _headers._Authority; + } + return value; + } + set + { + _bits |= 0x80000L; + _headers._Authority = value; + } + } + public StringValues HeaderMethod + { + get + { + StringValues value = default; + if ((_bits & 0x100000L) != 0) + { + value = _headers._Method; + } + return value; + } + set + { + _bits |= 0x100000L; + _headers._Method = value; + } + } + public StringValues HeaderPath + { + get + { + StringValues value = default; + if ((_bits & 0x200000L) != 0) + { + value = _headers._Path; + } + return value; + } + set + { + _bits |= 0x200000L; + _headers._Path = value; + } + } + public StringValues HeaderScheme + { + get + { + StringValues value = default; + if ((_bits & 0x400000L) != 0) + { + value = _headers._Scheme; + } + return value; + } + set + { + _bits |= 0x400000L; + _headers._Scheme = value; + } + } + public StringValues HeaderAccept + { + get + { + StringValues value = default; + if ((_bits & 0x800000L) != 0) { value = _headers._Accept; } @@ -360,7 +503,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x80000L; + _bits |= 0x800000L; _headers._Accept = value; } } @@ -369,7 +512,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x100000L) != 0) + if ((_bits & 0x1000000L) != 0) { value = _headers._AcceptCharset; } @@ -377,7 +520,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x100000L; + _bits |= 0x1000000L; _headers._AcceptCharset = value; } } @@ -386,7 +529,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x200000L) != 0) + if ((_bits & 0x2000000L) != 0) { value = _headers._AcceptEncoding; } @@ -394,7 +537,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x200000L; + _bits |= 0x2000000L; _headers._AcceptEncoding = value; } } @@ -403,7 +546,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x400000L) != 0) + if ((_bits & 0x4000000L) != 0) { value = _headers._AcceptLanguage; } @@ -411,7 +554,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x400000L; + _bits |= 0x4000000L; _headers._AcceptLanguage = value; } } @@ -420,7 +563,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x800000L) != 0) + if ((_bits & 0x8000000L) != 0) { value = _headers._Authorization; } @@ -428,7 +571,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x800000L; + _bits |= 0x8000000L; _headers._Authorization = value; } } @@ -437,7 +580,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x1000000L) != 0) + if ((_bits & 0x10000000L) != 0) { value = _headers._Cookie; } @@ -445,7 +588,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x1000000L; + _bits |= 0x10000000L; _headers._Cookie = value; } } @@ -454,7 +597,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x2000000L) != 0) + if ((_bits & 0x20000000L) != 0) { value = _headers._Expect; } @@ -462,7 +605,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x2000000L; + _bits |= 0x20000000L; _headers._Expect = value; } } @@ -471,7 +614,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x4000000L) != 0) + if ((_bits & 0x40000000L) != 0) { value = _headers._From; } @@ -479,7 +622,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x4000000L; + _bits |= 0x40000000L; _headers._From = value; } } @@ -488,7 +631,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x8000000L) != 0) + if ((_bits & 0x80000000L) != 0) { value = _headers._Host; } @@ -496,7 +639,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x8000000L; + _bits |= 0x80000000L; _headers._Host = value; } } @@ -505,7 +648,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x10000000L) != 0) + if ((_bits & 0x100000000L) != 0) { value = _headers._IfMatch; } @@ -513,7 +656,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x10000000L; + _bits |= 0x100000000L; _headers._IfMatch = value; } } @@ -522,7 +665,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x20000000L) != 0) + if ((_bits & 0x200000000L) != 0) { value = _headers._IfModifiedSince; } @@ -530,7 +673,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x20000000L; + _bits |= 0x200000000L; _headers._IfModifiedSince = value; } } @@ -539,7 +682,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x40000000L) != 0) + if ((_bits & 0x400000000L) != 0) { value = _headers._IfNoneMatch; } @@ -547,7 +690,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x40000000L; + _bits |= 0x400000000L; _headers._IfNoneMatch = value; } } @@ -556,7 +699,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x80000000L) != 0) + if ((_bits & 0x800000000L) != 0) { value = _headers._IfRange; } @@ -564,7 +707,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x80000000L; + _bits |= 0x800000000L; _headers._IfRange = value; } } @@ -573,7 +716,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x100000000L) != 0) + if ((_bits & 0x1000000000L) != 0) { value = _headers._IfUnmodifiedSince; } @@ -581,7 +724,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x100000000L; + _bits |= 0x1000000000L; _headers._IfUnmodifiedSince = value; } } @@ -590,7 +733,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x200000000L) != 0) + if ((_bits & 0x2000000000L) != 0) { value = _headers._MaxForwards; } @@ -598,7 +741,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x200000000L; + _bits |= 0x2000000000L; _headers._MaxForwards = value; } } @@ -607,7 +750,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x400000000L) != 0) + if ((_bits & 0x4000000000L) != 0) { value = _headers._ProxyAuthorization; } @@ -615,7 +758,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x400000000L; + _bits |= 0x4000000000L; _headers._ProxyAuthorization = value; } } @@ -624,7 +767,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x800000000L) != 0) + if ((_bits & 0x8000000000L) != 0) { value = _headers._Referer; } @@ -632,7 +775,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x800000000L; + _bits |= 0x8000000000L; _headers._Referer = value; } } @@ -641,7 +784,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x1000000000L) != 0) + if ((_bits & 0x10000000000L) != 0) { value = _headers._Range; } @@ -649,7 +792,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x1000000000L; + _bits |= 0x10000000000L; _headers._Range = value; } } @@ -658,7 +801,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x2000000000L) != 0) + if ((_bits & 0x20000000000L) != 0) { value = _headers._TE; } @@ -666,7 +809,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x2000000000L; + _bits |= 0x20000000000L; _headers._TE = value; } } @@ -675,7 +818,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x4000000000L) != 0) + if ((_bits & 0x40000000000L) != 0) { value = _headers._Translate; } @@ -683,7 +826,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x4000000000L; + _bits |= 0x40000000000L; _headers._Translate = value; } } @@ -692,7 +835,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x8000000000L) != 0) + if ((_bits & 0x80000000000L) != 0) { value = _headers._UserAgent; } @@ -700,7 +843,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x8000000000L; + _bits |= 0x80000000000L; _headers._UserAgent = value; } } @@ -709,7 +852,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x10000000000L) != 0) + if ((_bits & 0x100000000000L) != 0) { value = _headers._DNT; } @@ -717,7 +860,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x10000000000L; + _bits |= 0x100000000000L; _headers._DNT = value; } } @@ -726,7 +869,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x20000000000L) != 0) + if ((_bits & 0x200000000000L) != 0) { value = _headers._UpgradeInsecureRequests; } @@ -734,7 +877,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x20000000000L; + _bits |= 0x200000000000L; _headers._UpgradeInsecureRequests = value; } } @@ -743,7 +886,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x40000000000L) != 0) + if ((_bits & 0x400000000000L) != 0) { value = _headers._RequestId; } @@ -751,7 +894,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x40000000000L; + _bits |= 0x400000000000L; _headers._RequestId = value; } } @@ -760,7 +903,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x80000000000L) != 0) + if ((_bits & 0x800000000000L) != 0) { value = _headers._CorrelationContext; } @@ -768,7 +911,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x80000000000L; + _bits |= 0x800000000000L; _headers._CorrelationContext = value; } } @@ -777,7 +920,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x100000000000L) != 0) + if ((_bits & 0x1000000000000L) != 0) { value = _headers._TraceParent; } @@ -785,7 +928,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x100000000000L; + _bits |= 0x1000000000000L; _headers._TraceParent = value; } } @@ -794,7 +937,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x200000000000L) != 0) + if ((_bits & 0x2000000000000L) != 0) { value = _headers._TraceState; } @@ -802,7 +945,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x200000000000L; + _bits |= 0x2000000000000L; _headers._TraceState = value; } } @@ -811,7 +954,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x400000000000L) != 0) + if ((_bits & 0x4000000000000L) != 0) { value = _headers._Origin; } @@ -819,7 +962,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x400000000000L; + _bits |= 0x4000000000000L; _headers._Origin = value; } } @@ -828,7 +971,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x800000000000L) != 0) + if ((_bits & 0x8000000000000L) != 0) { value = _headers._AccessControlRequestMethod; } @@ -836,7 +979,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x800000000000L; + _bits |= 0x8000000000000L; _headers._AccessControlRequestMethod = value; } } @@ -845,7 +988,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http get { StringValues value = default; - if ((_bits & 0x1000000000000L) != 0) + if ((_bits & 0x10000000000000L) != 0) { value = _headers._AccessControlRequestHeaders; } @@ -853,7 +996,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } set { - _bits |= 0x1000000000000L; + _bits |= 0x10000000000000L; _headers._AccessControlRequestHeaders = value; } } @@ -888,7 +1031,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.TE, key)) { - if ((_bits & 0x2000000000L) != 0) + if ((_bits & 0x20000000000L) != 0) { value = _headers._TE; return true; @@ -898,7 +1041,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.TE.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x2000000000L) != 0) + if ((_bits & 0x20000000000L) != 0) { value = _headers._TE; return true; @@ -920,7 +1063,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.DNT, key)) { - if ((_bits & 0x10000000000L) != 0) + if ((_bits & 0x100000000000L) != 0) { value = _headers._DNT; return true; @@ -939,7 +1082,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.DNT.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x10000000000L) != 0) + if ((_bits & 0x100000000000L) != 0) { value = _headers._DNT; return true; @@ -952,7 +1095,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.Host, key)) { - if ((_bits & 0x8000000L) != 0) + if ((_bits & 0x80000000L) != 0) { value = _headers._Host; return true; @@ -970,7 +1113,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.From, key)) { - if ((_bits & 0x4000000L) != 0) + if ((_bits & 0x40000000L) != 0) { value = _headers._From; return true; @@ -980,7 +1123,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.Host.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x8000000L) != 0) + if ((_bits & 0x80000000L) != 0) { value = _headers._Host; return true; @@ -998,7 +1141,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.From.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x4000000L) != 0) + if ((_bits & 0x40000000L) != 0) { value = _headers._From; return true; @@ -1009,6 +1152,15 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } case 5: { + if (ReferenceEquals(HeaderNames.Path, key)) + { + if ((_bits & 0x200000L) != 0) + { + value = _headers._Path; + return true; + } + return false; + } if (ReferenceEquals(HeaderNames.Allow, key)) { if ((_bits & 0x400L) != 0) @@ -1020,7 +1172,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.Range, key)) { - if ((_bits & 0x1000000000L) != 0) + if ((_bits & 0x10000000000L) != 0) { value = _headers._Range; return true; @@ -1028,6 +1180,15 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http return false; } + if (HeaderNames.Path.Equals(key, StringComparison.OrdinalIgnoreCase)) + { + if ((_bits & 0x200000L) != 0) + { + value = _headers._Path; + return true; + } + return false; + } if (HeaderNames.Allow.Equals(key, StringComparison.OrdinalIgnoreCase)) { if ((_bits & 0x400L) != 0) @@ -1039,7 +1200,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.Range.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x1000000000L) != 0) + if ((_bits & 0x10000000000L) != 0) { value = _headers._Range; return true; @@ -1052,7 +1213,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.Accept, key)) { - if ((_bits & 0x80000L) != 0) + if ((_bits & 0x800000L) != 0) { value = _headers._Accept; return true; @@ -1070,7 +1231,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.Cookie, key)) { - if ((_bits & 0x1000000L) != 0) + if ((_bits & 0x10000000L) != 0) { value = _headers._Cookie; return true; @@ -1079,7 +1240,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.Expect, key)) { - if ((_bits & 0x2000000L) != 0) + if ((_bits & 0x20000000L) != 0) { value = _headers._Expect; return true; @@ -1088,7 +1249,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.Origin, key)) { - if ((_bits & 0x400000000000L) != 0) + if ((_bits & 0x4000000000000L) != 0) { value = _headers._Origin; return true; @@ -1098,7 +1259,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.Accept.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x80000L) != 0) + if ((_bits & 0x800000L) != 0) { value = _headers._Accept; return true; @@ -1116,7 +1277,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.Cookie.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x1000000L) != 0) + if ((_bits & 0x10000000L) != 0) { value = _headers._Cookie; return true; @@ -1125,7 +1286,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.Expect.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x2000000L) != 0) + if ((_bits & 0x20000000L) != 0) { value = _headers._Expect; return true; @@ -1134,7 +1295,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.Origin.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x400000000000L) != 0) + if ((_bits & 0x4000000000000L) != 0) { value = _headers._Origin; return true; @@ -1145,6 +1306,24 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } case 7: { + if (ReferenceEquals(HeaderNames.Method, key)) + { + if ((_bits & 0x100000L) != 0) + { + value = _headers._Method; + return true; + } + return false; + } + if (ReferenceEquals(HeaderNames.Scheme, key)) + { + if ((_bits & 0x400000L) != 0) + { + value = _headers._Scheme; + return true; + } + return false; + } if (ReferenceEquals(HeaderNames.Trailer, key)) { if ((_bits & 0x20L) != 0) @@ -1183,7 +1362,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.Referer, key)) { - if ((_bits & 0x800000000L) != 0) + if ((_bits & 0x8000000000L) != 0) { value = _headers._Referer; return true; @@ -1191,6 +1370,24 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http return false; } + if (HeaderNames.Method.Equals(key, StringComparison.OrdinalIgnoreCase)) + { + if ((_bits & 0x100000L) != 0) + { + value = _headers._Method; + return true; + } + return false; + } + if (HeaderNames.Scheme.Equals(key, StringComparison.OrdinalIgnoreCase)) + { + if ((_bits & 0x400000L) != 0) + { + value = _headers._Scheme; + return true; + } + return false; + } if (HeaderNames.Trailer.Equals(key, StringComparison.OrdinalIgnoreCase)) { if ((_bits & 0x20L) != 0) @@ -1229,7 +1426,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.Referer.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x800000000L) != 0) + if ((_bits & 0x8000000000L) != 0) { value = _headers._Referer; return true; @@ -1242,7 +1439,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.IfMatch, key)) { - if ((_bits & 0x10000000L) != 0) + if ((_bits & 0x100000000L) != 0) { value = _headers._IfMatch; return true; @@ -1251,7 +1448,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.IfRange, key)) { - if ((_bits & 0x80000000L) != 0) + if ((_bits & 0x800000000L) != 0) { value = _headers._IfRange; return true; @@ -1261,7 +1458,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.IfMatch.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x10000000L) != 0) + if ((_bits & 0x100000000L) != 0) { value = _headers._IfMatch; return true; @@ -1270,7 +1467,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.IfRange.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x80000000L) != 0) + if ((_bits & 0x800000000L) != 0) { value = _headers._IfRange; return true; @@ -1283,7 +1480,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.Translate, key)) { - if ((_bits & 0x4000000000L) != 0) + if ((_bits & 0x40000000000L) != 0) { value = _headers._Translate; return true; @@ -1293,7 +1490,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.Translate.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x4000000000L) != 0) + if ((_bits & 0x40000000000L) != 0) { value = _headers._Translate; return true; @@ -1313,9 +1510,18 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } return false; } + if (ReferenceEquals(HeaderNames.Authority, key)) + { + if ((_bits & 0x80000L) != 0) + { + value = _headers._Authority; + return true; + } + return false; + } if (ReferenceEquals(HeaderNames.UserAgent, key)) { - if ((_bits & 0x8000000000L) != 0) + if ((_bits & 0x80000000000L) != 0) { value = _headers._UserAgent; return true; @@ -1333,7 +1539,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.RequestId, key)) { - if ((_bits & 0x40000000000L) != 0) + if ((_bits & 0x400000000000L) != 0) { value = _headers._RequestId; return true; @@ -1342,7 +1548,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.TraceState, key)) { - if ((_bits & 0x200000000000L) != 0) + if ((_bits & 0x2000000000000L) != 0) { value = _headers._TraceState; return true; @@ -1359,9 +1565,18 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } return false; } + if (HeaderNames.Authority.Equals(key, StringComparison.OrdinalIgnoreCase)) + { + if ((_bits & 0x80000L) != 0) + { + value = _headers._Authority; + return true; + } + return false; + } if (HeaderNames.UserAgent.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x8000000000L) != 0) + if ((_bits & 0x80000000000L) != 0) { value = _headers._UserAgent; return true; @@ -1379,7 +1594,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.RequestId.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x40000000000L) != 0) + if ((_bits & 0x400000000000L) != 0) { value = _headers._RequestId; return true; @@ -1388,7 +1603,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.TraceState.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x200000000000L) != 0) + if ((_bits & 0x2000000000000L) != 0) { value = _headers._TraceState; return true; @@ -1410,7 +1625,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.TraceParent, key)) { - if ((_bits & 0x100000000000L) != 0) + if ((_bits & 0x1000000000000L) != 0) { value = _headers._TraceParent; return true; @@ -1429,7 +1644,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.TraceParent.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x100000000000L) != 0) + if ((_bits & 0x1000000000000L) != 0) { value = _headers._TraceParent; return true; @@ -1451,7 +1666,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.MaxForwards, key)) { - if ((_bits & 0x200000000L) != 0) + if ((_bits & 0x2000000000L) != 0) { value = _headers._MaxForwards; return true; @@ -1470,7 +1685,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.MaxForwards.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x200000000L) != 0) + if ((_bits & 0x2000000000L) != 0) { value = _headers._MaxForwards; return true; @@ -1510,7 +1725,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.Authorization, key)) { - if ((_bits & 0x800000L) != 0) + if ((_bits & 0x8000000L) != 0) { value = _headers._Authorization; return true; @@ -1519,7 +1734,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.IfNoneMatch, key)) { - if ((_bits & 0x40000000L) != 0) + if ((_bits & 0x400000000L) != 0) { value = _headers._IfNoneMatch; return true; @@ -1556,7 +1771,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.Authorization.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x800000L) != 0) + if ((_bits & 0x8000000L) != 0) { value = _headers._Authorization; return true; @@ -1565,7 +1780,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.IfNoneMatch.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x40000000L) != 0) + if ((_bits & 0x400000000L) != 0) { value = _headers._IfNoneMatch; return true; @@ -1578,7 +1793,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.AcceptCharset, key)) { - if ((_bits & 0x100000L) != 0) + if ((_bits & 0x1000000L) != 0) { value = _headers._AcceptCharset; return true; @@ -1597,7 +1812,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.AcceptCharset.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x100000L) != 0) + if ((_bits & 0x1000000L) != 0) { value = _headers._AcceptCharset; return true; @@ -1619,7 +1834,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.AcceptEncoding, key)) { - if ((_bits & 0x200000L) != 0) + if ((_bits & 0x2000000L) != 0) { value = _headers._AcceptEncoding; return true; @@ -1628,7 +1843,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.AcceptLanguage, key)) { - if ((_bits & 0x400000L) != 0) + if ((_bits & 0x4000000L) != 0) { value = _headers._AcceptLanguage; return true; @@ -1638,7 +1853,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.AcceptEncoding.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x200000L) != 0) + if ((_bits & 0x2000000L) != 0) { value = _headers._AcceptEncoding; return true; @@ -1647,7 +1862,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.AcceptLanguage.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x400000L) != 0) + if ((_bits & 0x4000000L) != 0) { value = _headers._AcceptLanguage; return true; @@ -1728,7 +1943,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.IfModifiedSince, key)) { - if ((_bits & 0x20000000L) != 0) + if ((_bits & 0x200000000L) != 0) { value = _headers._IfModifiedSince; return true; @@ -1747,7 +1962,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.IfModifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x20000000L) != 0) + if ((_bits & 0x200000000L) != 0) { value = _headers._IfModifiedSince; return true; @@ -1760,7 +1975,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.IfUnmodifiedSince, key)) { - if ((_bits & 0x100000000L) != 0) + if ((_bits & 0x1000000000L) != 0) { value = _headers._IfUnmodifiedSince; return true; @@ -1769,7 +1984,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.ProxyAuthorization, key)) { - if ((_bits & 0x400000000L) != 0) + if ((_bits & 0x4000000000L) != 0) { value = _headers._ProxyAuthorization; return true; @@ -1778,7 +1993,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.CorrelationContext, key)) { - if ((_bits & 0x80000000000L) != 0) + if ((_bits & 0x800000000000L) != 0) { value = _headers._CorrelationContext; return true; @@ -1788,7 +2003,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.IfUnmodifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x100000000L) != 0) + if ((_bits & 0x1000000000L) != 0) { value = _headers._IfUnmodifiedSince; return true; @@ -1797,7 +2012,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.ProxyAuthorization.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x400000000L) != 0) + if ((_bits & 0x4000000000L) != 0) { value = _headers._ProxyAuthorization; return true; @@ -1806,7 +2021,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.CorrelationContext.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x80000000000L) != 0) + if ((_bits & 0x800000000000L) != 0) { value = _headers._CorrelationContext; return true; @@ -1819,7 +2034,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.UpgradeInsecureRequests, key)) { - if ((_bits & 0x20000000000L) != 0) + if ((_bits & 0x200000000000L) != 0) { value = _headers._UpgradeInsecureRequests; return true; @@ -1829,7 +2044,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.UpgradeInsecureRequests.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x20000000000L) != 0) + if ((_bits & 0x200000000000L) != 0) { value = _headers._UpgradeInsecureRequests; return true; @@ -1842,7 +2057,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.AccessControlRequestMethod, key)) { - if ((_bits & 0x800000000000L) != 0) + if ((_bits & 0x8000000000000L) != 0) { value = _headers._AccessControlRequestMethod; return true; @@ -1852,7 +2067,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.AccessControlRequestMethod.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x800000000000L) != 0) + if ((_bits & 0x8000000000000L) != 0) { value = _headers._AccessControlRequestMethod; return true; @@ -1865,7 +2080,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.AccessControlRequestHeaders, key)) { - if ((_bits & 0x1000000000000L) != 0) + if ((_bits & 0x10000000000000L) != 0) { value = _headers._AccessControlRequestHeaders; return true; @@ -1875,7 +2090,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.AccessControlRequestHeaders.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x1000000000000L) != 0) + if ((_bits & 0x10000000000000L) != 0) { value = _headers._AccessControlRequestHeaders; return true; @@ -1897,14 +2112,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.TE, key)) { - _bits |= 0x2000000000L; + _bits |= 0x20000000000L; _headers._TE = value; return; } if (HeaderNames.TE.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x2000000000L; + _bits |= 0x20000000000L; _headers._TE = value; return; } @@ -1920,7 +2135,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.DNT, key)) { - _bits |= 0x10000000000L; + _bits |= 0x100000000000L; _headers._DNT = value; return; } @@ -1933,7 +2148,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.DNT.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x10000000000L; + _bits |= 0x100000000000L; _headers._DNT = value; return; } @@ -1943,7 +2158,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.Host, key)) { - _bits |= 0x8000000L; + _bits |= 0x80000000L; _headers._Host = value; return; } @@ -1955,14 +2170,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.From, key)) { - _bits |= 0x4000000L; + _bits |= 0x40000000L; _headers._From = value; return; } if (HeaderNames.Host.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x8000000L; + _bits |= 0x80000000L; _headers._Host = value; return; } @@ -1974,7 +2189,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.From.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x4000000L; + _bits |= 0x40000000L; _headers._From = value; return; } @@ -1982,6 +2197,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } case 5: { + if (ReferenceEquals(HeaderNames.Path, key)) + { + _bits |= 0x200000L; + _headers._Path = value; + return; + } if (ReferenceEquals(HeaderNames.Allow, key)) { _bits |= 0x400L; @@ -1990,11 +2211,17 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.Range, key)) { - _bits |= 0x1000000000L; + _bits |= 0x10000000000L; _headers._Range = value; return; } + if (HeaderNames.Path.Equals(key, StringComparison.OrdinalIgnoreCase)) + { + _bits |= 0x200000L; + _headers._Path = value; + return; + } if (HeaderNames.Allow.Equals(key, StringComparison.OrdinalIgnoreCase)) { _bits |= 0x400L; @@ -2003,7 +2230,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.Range.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x1000000000L; + _bits |= 0x10000000000L; _headers._Range = value; return; } @@ -2013,7 +2240,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.Accept, key)) { - _bits |= 0x80000L; + _bits |= 0x800000L; _headers._Accept = value; return; } @@ -2025,26 +2252,26 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.Cookie, key)) { - _bits |= 0x1000000L; + _bits |= 0x10000000L; _headers._Cookie = value; return; } if (ReferenceEquals(HeaderNames.Expect, key)) { - _bits |= 0x2000000L; + _bits |= 0x20000000L; _headers._Expect = value; return; } if (ReferenceEquals(HeaderNames.Origin, key)) { - _bits |= 0x400000000000L; + _bits |= 0x4000000000000L; _headers._Origin = value; return; } if (HeaderNames.Accept.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x80000L; + _bits |= 0x800000L; _headers._Accept = value; return; } @@ -2056,19 +2283,19 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.Cookie.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x1000000L; + _bits |= 0x10000000L; _headers._Cookie = value; return; } if (HeaderNames.Expect.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x2000000L; + _bits |= 0x20000000L; _headers._Expect = value; return; } if (HeaderNames.Origin.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x400000000000L; + _bits |= 0x4000000000000L; _headers._Origin = value; return; } @@ -2076,6 +2303,18 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } case 7: { + if (ReferenceEquals(HeaderNames.Method, key)) + { + _bits |= 0x100000L; + _headers._Method = value; + return; + } + if (ReferenceEquals(HeaderNames.Scheme, key)) + { + _bits |= 0x400000L; + _headers._Scheme = value; + return; + } if (ReferenceEquals(HeaderNames.Trailer, key)) { _bits |= 0x20L; @@ -2102,11 +2341,23 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.Referer, key)) { - _bits |= 0x800000000L; + _bits |= 0x8000000000L; _headers._Referer = value; return; } + if (HeaderNames.Method.Equals(key, StringComparison.OrdinalIgnoreCase)) + { + _bits |= 0x100000L; + _headers._Method = value; + return; + } + if (HeaderNames.Scheme.Equals(key, StringComparison.OrdinalIgnoreCase)) + { + _bits |= 0x400000L; + _headers._Scheme = value; + return; + } if (HeaderNames.Trailer.Equals(key, StringComparison.OrdinalIgnoreCase)) { _bits |= 0x20L; @@ -2133,7 +2384,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.Referer.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x800000000L; + _bits |= 0x8000000000L; _headers._Referer = value; return; } @@ -2143,26 +2394,26 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.IfMatch, key)) { - _bits |= 0x10000000L; + _bits |= 0x100000000L; _headers._IfMatch = value; return; } if (ReferenceEquals(HeaderNames.IfRange, key)) { - _bits |= 0x80000000L; + _bits |= 0x800000000L; _headers._IfRange = value; return; } if (HeaderNames.IfMatch.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x10000000L; + _bits |= 0x100000000L; _headers._IfMatch = value; return; } if (HeaderNames.IfRange.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x80000000L; + _bits |= 0x800000000L; _headers._IfRange = value; return; } @@ -2172,14 +2423,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.Translate, key)) { - _bits |= 0x4000000000L; + _bits |= 0x40000000000L; _headers._Translate = value; return; } if (HeaderNames.Translate.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x4000000000L; + _bits |= 0x40000000000L; _headers._Translate = value; return; } @@ -2193,9 +2444,15 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http _headers._Connection = value; return; } + if (ReferenceEquals(HeaderNames.Authority, key)) + { + _bits |= 0x80000L; + _headers._Authority = value; + return; + } if (ReferenceEquals(HeaderNames.UserAgent, key)) { - _bits |= 0x8000000000L; + _bits |= 0x80000000000L; _headers._UserAgent = value; return; } @@ -2207,13 +2464,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.RequestId, key)) { - _bits |= 0x40000000000L; + _bits |= 0x400000000000L; _headers._RequestId = value; return; } if (ReferenceEquals(HeaderNames.TraceState, key)) { - _bits |= 0x200000000000L; + _bits |= 0x2000000000000L; _headers._TraceState = value; return; } @@ -2224,9 +2481,15 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http _headers._Connection = value; return; } + if (HeaderNames.Authority.Equals(key, StringComparison.OrdinalIgnoreCase)) + { + _bits |= 0x80000L; + _headers._Authority = value; + return; + } if (HeaderNames.UserAgent.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x8000000000L; + _bits |= 0x80000000000L; _headers._UserAgent = value; return; } @@ -2238,13 +2501,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.RequestId.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x40000000000L; + _bits |= 0x400000000000L; _headers._RequestId = value; return; } if (HeaderNames.TraceState.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x200000000000L; + _bits |= 0x2000000000000L; _headers._TraceState = value; return; } @@ -2260,7 +2523,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.TraceParent, key)) { - _bits |= 0x100000000000L; + _bits |= 0x1000000000000L; _headers._TraceParent = value; return; } @@ -2273,7 +2536,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.TraceParent.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x100000000000L; + _bits |= 0x1000000000000L; _headers._TraceParent = value; return; } @@ -2289,7 +2552,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.MaxForwards, key)) { - _bits |= 0x200000000L; + _bits |= 0x2000000000L; _headers._MaxForwards = value; return; } @@ -2302,7 +2565,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.MaxForwards.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x200000000L; + _bits |= 0x2000000000L; _headers._MaxForwards = value; return; } @@ -2330,13 +2593,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.Authorization, key)) { - _bits |= 0x800000L; + _bits |= 0x8000000L; _headers._Authorization = value; return; } if (ReferenceEquals(HeaderNames.IfNoneMatch, key)) { - _bits |= 0x40000000L; + _bits |= 0x400000000L; _headers._IfNoneMatch = value; return; } @@ -2361,13 +2624,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.Authorization.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x800000L; + _bits |= 0x8000000L; _headers._Authorization = value; return; } if (HeaderNames.IfNoneMatch.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x40000000L; + _bits |= 0x400000000L; _headers._IfNoneMatch = value; return; } @@ -2377,7 +2640,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.AcceptCharset, key)) { - _bits |= 0x100000L; + _bits |= 0x1000000L; _headers._AcceptCharset = value; return; } @@ -2389,7 +2652,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.AcceptCharset.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x100000L; + _bits |= 0x1000000L; _headers._AcceptCharset = value; return; } @@ -2404,26 +2667,26 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.AcceptEncoding, key)) { - _bits |= 0x200000L; + _bits |= 0x2000000L; _headers._AcceptEncoding = value; return; } if (ReferenceEquals(HeaderNames.AcceptLanguage, key)) { - _bits |= 0x400000L; + _bits |= 0x4000000L; _headers._AcceptLanguage = value; return; } if (HeaderNames.AcceptEncoding.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x200000L; + _bits |= 0x2000000L; _headers._AcceptEncoding = value; return; } if (HeaderNames.AcceptLanguage.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x400000L; + _bits |= 0x4000000L; _headers._AcceptLanguage = value; return; } @@ -2480,7 +2743,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.IfModifiedSince, key)) { - _bits |= 0x20000000L; + _bits |= 0x200000000L; _headers._IfModifiedSince = value; return; } @@ -2493,7 +2756,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.IfModifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x20000000L; + _bits |= 0x200000000L; _headers._IfModifiedSince = value; return; } @@ -2503,38 +2766,38 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.IfUnmodifiedSince, key)) { - _bits |= 0x100000000L; + _bits |= 0x1000000000L; _headers._IfUnmodifiedSince = value; return; } if (ReferenceEquals(HeaderNames.ProxyAuthorization, key)) { - _bits |= 0x400000000L; + _bits |= 0x4000000000L; _headers._ProxyAuthorization = value; return; } if (ReferenceEquals(HeaderNames.CorrelationContext, key)) { - _bits |= 0x80000000000L; + _bits |= 0x800000000000L; _headers._CorrelationContext = value; return; } if (HeaderNames.IfUnmodifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x100000000L; + _bits |= 0x1000000000L; _headers._IfUnmodifiedSince = value; return; } if (HeaderNames.ProxyAuthorization.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x400000000L; + _bits |= 0x4000000000L; _headers._ProxyAuthorization = value; return; } if (HeaderNames.CorrelationContext.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x80000000000L; + _bits |= 0x800000000000L; _headers._CorrelationContext = value; return; } @@ -2544,14 +2807,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.UpgradeInsecureRequests, key)) { - _bits |= 0x20000000000L; + _bits |= 0x200000000000L; _headers._UpgradeInsecureRequests = value; return; } if (HeaderNames.UpgradeInsecureRequests.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x20000000000L; + _bits |= 0x200000000000L; _headers._UpgradeInsecureRequests = value; return; } @@ -2561,14 +2824,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.AccessControlRequestMethod, key)) { - _bits |= 0x800000000000L; + _bits |= 0x8000000000000L; _headers._AccessControlRequestMethod = value; return; } if (HeaderNames.AccessControlRequestMethod.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x800000000000L; + _bits |= 0x8000000000000L; _headers._AccessControlRequestMethod = value; return; } @@ -2578,14 +2841,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.AccessControlRequestHeaders, key)) { - _bits |= 0x1000000000000L; + _bits |= 0x10000000000000L; _headers._AccessControlRequestHeaders = value; return; } if (HeaderNames.AccessControlRequestHeaders.Equals(key, StringComparison.OrdinalIgnoreCase)) { - _bits |= 0x1000000000000L; + _bits |= 0x10000000000000L; _headers._AccessControlRequestHeaders = value; return; } @@ -2604,9 +2867,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.TE, key)) { - if ((_bits & 0x2000000000L) == 0) + if ((_bits & 0x20000000000L) == 0) { - _bits |= 0x2000000000L; + _bits |= 0x20000000000L; _headers._TE = value; return true; } @@ -2615,9 +2878,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.TE.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x2000000000L) == 0) + if ((_bits & 0x20000000000L) == 0) { - _bits |= 0x2000000000L; + _bits |= 0x20000000000L; _headers._TE = value; return true; } @@ -2639,9 +2902,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.DNT, key)) { - if ((_bits & 0x10000000000L) == 0) + if ((_bits & 0x100000000000L) == 0) { - _bits |= 0x10000000000L; + _bits |= 0x100000000000L; _headers._DNT = value; return true; } @@ -2660,9 +2923,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.DNT.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x10000000000L) == 0) + if ((_bits & 0x100000000000L) == 0) { - _bits |= 0x10000000000L; + _bits |= 0x100000000000L; _headers._DNT = value; return true; } @@ -2674,9 +2937,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.Host, key)) { - if ((_bits & 0x8000000L) == 0) + if ((_bits & 0x80000000L) == 0) { - _bits |= 0x8000000L; + _bits |= 0x80000000L; _headers._Host = value; return true; } @@ -2694,9 +2957,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.From, key)) { - if ((_bits & 0x4000000L) == 0) + if ((_bits & 0x40000000L) == 0) { - _bits |= 0x4000000L; + _bits |= 0x40000000L; _headers._From = value; return true; } @@ -2705,9 +2968,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.Host.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x8000000L) == 0) + if ((_bits & 0x80000000L) == 0) { - _bits |= 0x8000000L; + _bits |= 0x80000000L; _headers._Host = value; return true; } @@ -2725,9 +2988,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.From.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x4000000L) == 0) + if ((_bits & 0x40000000L) == 0) { - _bits |= 0x4000000L; + _bits |= 0x40000000L; _headers._From = value; return true; } @@ -2737,6 +3000,16 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } case 5: { + if (ReferenceEquals(HeaderNames.Path, key)) + { + if ((_bits & 0x200000L) == 0) + { + _bits |= 0x200000L; + _headers._Path = value; + return true; + } + return false; + } if (ReferenceEquals(HeaderNames.Allow, key)) { if ((_bits & 0x400L) == 0) @@ -2749,15 +3022,25 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.Range, key)) { - if ((_bits & 0x1000000000L) == 0) + if ((_bits & 0x10000000000L) == 0) { - _bits |= 0x1000000000L; + _bits |= 0x10000000000L; _headers._Range = value; return true; } return false; } + if (HeaderNames.Path.Equals(key, StringComparison.OrdinalIgnoreCase)) + { + if ((_bits & 0x200000L) == 0) + { + _bits |= 0x200000L; + _headers._Path = value; + return true; + } + return false; + } if (HeaderNames.Allow.Equals(key, StringComparison.OrdinalIgnoreCase)) { if ((_bits & 0x400L) == 0) @@ -2770,9 +3053,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.Range.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x1000000000L) == 0) + if ((_bits & 0x10000000000L) == 0) { - _bits |= 0x1000000000L; + _bits |= 0x10000000000L; _headers._Range = value; return true; } @@ -2784,9 +3067,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.Accept, key)) { - if ((_bits & 0x80000L) == 0) + if ((_bits & 0x800000L) == 0) { - _bits |= 0x80000L; + _bits |= 0x800000L; _headers._Accept = value; return true; } @@ -2804,9 +3087,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.Cookie, key)) { - if ((_bits & 0x1000000L) == 0) + if ((_bits & 0x10000000L) == 0) { - _bits |= 0x1000000L; + _bits |= 0x10000000L; _headers._Cookie = value; return true; } @@ -2814,9 +3097,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.Expect, key)) { - if ((_bits & 0x2000000L) == 0) + if ((_bits & 0x20000000L) == 0) { - _bits |= 0x2000000L; + _bits |= 0x20000000L; _headers._Expect = value; return true; } @@ -2824,9 +3107,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.Origin, key)) { - if ((_bits & 0x400000000000L) == 0) + if ((_bits & 0x4000000000000L) == 0) { - _bits |= 0x400000000000L; + _bits |= 0x4000000000000L; _headers._Origin = value; return true; } @@ -2835,9 +3118,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.Accept.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x80000L) == 0) + if ((_bits & 0x800000L) == 0) { - _bits |= 0x80000L; + _bits |= 0x800000L; _headers._Accept = value; return true; } @@ -2855,9 +3138,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.Cookie.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x1000000L) == 0) + if ((_bits & 0x10000000L) == 0) { - _bits |= 0x1000000L; + _bits |= 0x10000000L; _headers._Cookie = value; return true; } @@ -2865,9 +3148,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.Expect.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x2000000L) == 0) + if ((_bits & 0x20000000L) == 0) { - _bits |= 0x2000000L; + _bits |= 0x20000000L; _headers._Expect = value; return true; } @@ -2875,9 +3158,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.Origin.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x400000000000L) == 0) + if ((_bits & 0x4000000000000L) == 0) { - _bits |= 0x400000000000L; + _bits |= 0x4000000000000L; _headers._Origin = value; return true; } @@ -2887,6 +3170,26 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } case 7: { + if (ReferenceEquals(HeaderNames.Method, key)) + { + if ((_bits & 0x100000L) == 0) + { + _bits |= 0x100000L; + _headers._Method = value; + return true; + } + return false; + } + if (ReferenceEquals(HeaderNames.Scheme, key)) + { + if ((_bits & 0x400000L) == 0) + { + _bits |= 0x400000L; + _headers._Scheme = value; + return true; + } + return false; + } if (ReferenceEquals(HeaderNames.Trailer, key)) { if ((_bits & 0x20L) == 0) @@ -2929,15 +3232,35 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.Referer, key)) { - if ((_bits & 0x800000000L) == 0) + if ((_bits & 0x8000000000L) == 0) { - _bits |= 0x800000000L; + _bits |= 0x8000000000L; _headers._Referer = value; return true; } return false; } + if (HeaderNames.Method.Equals(key, StringComparison.OrdinalIgnoreCase)) + { + if ((_bits & 0x100000L) == 0) + { + _bits |= 0x100000L; + _headers._Method = value; + return true; + } + return false; + } + if (HeaderNames.Scheme.Equals(key, StringComparison.OrdinalIgnoreCase)) + { + if ((_bits & 0x400000L) == 0) + { + _bits |= 0x400000L; + _headers._Scheme = value; + return true; + } + return false; + } if (HeaderNames.Trailer.Equals(key, StringComparison.OrdinalIgnoreCase)) { if ((_bits & 0x20L) == 0) @@ -2980,9 +3303,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.Referer.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x800000000L) == 0) + if ((_bits & 0x8000000000L) == 0) { - _bits |= 0x800000000L; + _bits |= 0x8000000000L; _headers._Referer = value; return true; } @@ -2994,9 +3317,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.IfMatch, key)) { - if ((_bits & 0x10000000L) == 0) + if ((_bits & 0x100000000L) == 0) { - _bits |= 0x10000000L; + _bits |= 0x100000000L; _headers._IfMatch = value; return true; } @@ -3004,9 +3327,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.IfRange, key)) { - if ((_bits & 0x80000000L) == 0) + if ((_bits & 0x800000000L) == 0) { - _bits |= 0x80000000L; + _bits |= 0x800000000L; _headers._IfRange = value; return true; } @@ -3015,9 +3338,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.IfMatch.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x10000000L) == 0) + if ((_bits & 0x100000000L) == 0) { - _bits |= 0x10000000L; + _bits |= 0x100000000L; _headers._IfMatch = value; return true; } @@ -3025,9 +3348,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.IfRange.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x80000000L) == 0) + if ((_bits & 0x800000000L) == 0) { - _bits |= 0x80000000L; + _bits |= 0x800000000L; _headers._IfRange = value; return true; } @@ -3039,9 +3362,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.Translate, key)) { - if ((_bits & 0x4000000000L) == 0) + if ((_bits & 0x40000000000L) == 0) { - _bits |= 0x4000000000L; + _bits |= 0x40000000000L; _headers._Translate = value; return true; } @@ -3050,9 +3373,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.Translate.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x4000000000L) == 0) + if ((_bits & 0x40000000000L) == 0) { - _bits |= 0x4000000000L; + _bits |= 0x40000000000L; _headers._Translate = value; return true; } @@ -3072,11 +3395,21 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } return false; } + if (ReferenceEquals(HeaderNames.Authority, key)) + { + if ((_bits & 0x80000L) == 0) + { + _bits |= 0x80000L; + _headers._Authority = value; + return true; + } + return false; + } if (ReferenceEquals(HeaderNames.UserAgent, key)) { - if ((_bits & 0x8000000000L) == 0) + if ((_bits & 0x80000000000L) == 0) { - _bits |= 0x8000000000L; + _bits |= 0x80000000000L; _headers._UserAgent = value; return true; } @@ -3094,9 +3427,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.RequestId, key)) { - if ((_bits & 0x40000000000L) == 0) + if ((_bits & 0x400000000000L) == 0) { - _bits |= 0x40000000000L; + _bits |= 0x400000000000L; _headers._RequestId = value; return true; } @@ -3104,9 +3437,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.TraceState, key)) { - if ((_bits & 0x200000000000L) == 0) + if ((_bits & 0x2000000000000L) == 0) { - _bits |= 0x200000000000L; + _bits |= 0x2000000000000L; _headers._TraceState = value; return true; } @@ -3123,11 +3456,21 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } return false; } + if (HeaderNames.Authority.Equals(key, StringComparison.OrdinalIgnoreCase)) + { + if ((_bits & 0x80000L) == 0) + { + _bits |= 0x80000L; + _headers._Authority = value; + return true; + } + return false; + } if (HeaderNames.UserAgent.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x8000000000L) == 0) + if ((_bits & 0x80000000000L) == 0) { - _bits |= 0x8000000000L; + _bits |= 0x80000000000L; _headers._UserAgent = value; return true; } @@ -3145,9 +3488,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.RequestId.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x40000000000L) == 0) + if ((_bits & 0x400000000000L) == 0) { - _bits |= 0x40000000000L; + _bits |= 0x400000000000L; _headers._RequestId = value; return true; } @@ -3155,9 +3498,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.TraceState.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x200000000000L) == 0) + if ((_bits & 0x2000000000000L) == 0) { - _bits |= 0x200000000000L; + _bits |= 0x2000000000000L; _headers._TraceState = value; return true; } @@ -3179,9 +3522,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.TraceParent, key)) { - if ((_bits & 0x100000000000L) == 0) + if ((_bits & 0x1000000000000L) == 0) { - _bits |= 0x100000000000L; + _bits |= 0x1000000000000L; _headers._TraceParent = value; return true; } @@ -3200,9 +3543,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.TraceParent.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x100000000000L) == 0) + if ((_bits & 0x1000000000000L) == 0) { - _bits |= 0x100000000000L; + _bits |= 0x1000000000000L; _headers._TraceParent = value; return true; } @@ -3224,9 +3567,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.MaxForwards, key)) { - if ((_bits & 0x200000000L) == 0) + if ((_bits & 0x2000000000L) == 0) { - _bits |= 0x200000000L; + _bits |= 0x2000000000L; _headers._MaxForwards = value; return true; } @@ -3245,9 +3588,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.MaxForwards.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x200000000L) == 0) + if ((_bits & 0x2000000000L) == 0) { - _bits |= 0x200000000L; + _bits |= 0x2000000000L; _headers._MaxForwards = value; return true; } @@ -3289,9 +3632,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.Authorization, key)) { - if ((_bits & 0x800000L) == 0) + if ((_bits & 0x8000000L) == 0) { - _bits |= 0x800000L; + _bits |= 0x8000000L; _headers._Authorization = value; return true; } @@ -3299,9 +3642,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.IfNoneMatch, key)) { - if ((_bits & 0x40000000L) == 0) + if ((_bits & 0x400000000L) == 0) { - _bits |= 0x40000000L; + _bits |= 0x400000000L; _headers._IfNoneMatch = value; return true; } @@ -3340,9 +3683,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.Authorization.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x800000L) == 0) + if ((_bits & 0x8000000L) == 0) { - _bits |= 0x800000L; + _bits |= 0x8000000L; _headers._Authorization = value; return true; } @@ -3350,9 +3693,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.IfNoneMatch.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x40000000L) == 0) + if ((_bits & 0x400000000L) == 0) { - _bits |= 0x40000000L; + _bits |= 0x400000000L; _headers._IfNoneMatch = value; return true; } @@ -3364,9 +3707,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.AcceptCharset, key)) { - if ((_bits & 0x100000L) == 0) + if ((_bits & 0x1000000L) == 0) { - _bits |= 0x100000L; + _bits |= 0x1000000L; _headers._AcceptCharset = value; return true; } @@ -3384,9 +3727,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.AcceptCharset.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x100000L) == 0) + if ((_bits & 0x1000000L) == 0) { - _bits |= 0x100000L; + _bits |= 0x1000000L; _headers._AcceptCharset = value; return true; } @@ -3407,9 +3750,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.AcceptEncoding, key)) { - if ((_bits & 0x200000L) == 0) + if ((_bits & 0x2000000L) == 0) { - _bits |= 0x200000L; + _bits |= 0x2000000L; _headers._AcceptEncoding = value; return true; } @@ -3417,9 +3760,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.AcceptLanguage, key)) { - if ((_bits & 0x400000L) == 0) + if ((_bits & 0x4000000L) == 0) { - _bits |= 0x400000L; + _bits |= 0x4000000L; _headers._AcceptLanguage = value; return true; } @@ -3428,9 +3771,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.AcceptEncoding.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x200000L) == 0) + if ((_bits & 0x2000000L) == 0) { - _bits |= 0x200000L; + _bits |= 0x2000000L; _headers._AcceptEncoding = value; return true; } @@ -3438,9 +3781,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.AcceptLanguage.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x400000L) == 0) + if ((_bits & 0x4000000L) == 0) { - _bits |= 0x400000L; + _bits |= 0x4000000L; _headers._AcceptLanguage = value; return true; } @@ -3527,9 +3870,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.IfModifiedSince, key)) { - if ((_bits & 0x20000000L) == 0) + if ((_bits & 0x200000000L) == 0) { - _bits |= 0x20000000L; + _bits |= 0x200000000L; _headers._IfModifiedSince = value; return true; } @@ -3548,9 +3891,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.IfModifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x20000000L) == 0) + if ((_bits & 0x200000000L) == 0) { - _bits |= 0x20000000L; + _bits |= 0x200000000L; _headers._IfModifiedSince = value; return true; } @@ -3562,9 +3905,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.IfUnmodifiedSince, key)) { - if ((_bits & 0x100000000L) == 0) + if ((_bits & 0x1000000000L) == 0) { - _bits |= 0x100000000L; + _bits |= 0x1000000000L; _headers._IfUnmodifiedSince = value; return true; } @@ -3572,9 +3915,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.ProxyAuthorization, key)) { - if ((_bits & 0x400000000L) == 0) + if ((_bits & 0x4000000000L) == 0) { - _bits |= 0x400000000L; + _bits |= 0x4000000000L; _headers._ProxyAuthorization = value; return true; } @@ -3582,9 +3925,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.CorrelationContext, key)) { - if ((_bits & 0x80000000000L) == 0) + if ((_bits & 0x800000000000L) == 0) { - _bits |= 0x80000000000L; + _bits |= 0x800000000000L; _headers._CorrelationContext = value; return true; } @@ -3593,9 +3936,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.IfUnmodifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x100000000L) == 0) + if ((_bits & 0x1000000000L) == 0) { - _bits |= 0x100000000L; + _bits |= 0x1000000000L; _headers._IfUnmodifiedSince = value; return true; } @@ -3603,9 +3946,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.ProxyAuthorization.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x400000000L) == 0) + if ((_bits & 0x4000000000L) == 0) { - _bits |= 0x400000000L; + _bits |= 0x4000000000L; _headers._ProxyAuthorization = value; return true; } @@ -3613,9 +3956,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.CorrelationContext.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x80000000000L) == 0) + if ((_bits & 0x800000000000L) == 0) { - _bits |= 0x80000000000L; + _bits |= 0x800000000000L; _headers._CorrelationContext = value; return true; } @@ -3627,9 +3970,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.UpgradeInsecureRequests, key)) { - if ((_bits & 0x20000000000L) == 0) + if ((_bits & 0x200000000000L) == 0) { - _bits |= 0x20000000000L; + _bits |= 0x200000000000L; _headers._UpgradeInsecureRequests = value; return true; } @@ -3638,9 +3981,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.UpgradeInsecureRequests.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x20000000000L) == 0) + if ((_bits & 0x200000000000L) == 0) { - _bits |= 0x20000000000L; + _bits |= 0x200000000000L; _headers._UpgradeInsecureRequests = value; return true; } @@ -3652,9 +3995,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.AccessControlRequestMethod, key)) { - if ((_bits & 0x800000000000L) == 0) + if ((_bits & 0x8000000000000L) == 0) { - _bits |= 0x800000000000L; + _bits |= 0x8000000000000L; _headers._AccessControlRequestMethod = value; return true; } @@ -3663,9 +4006,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.AccessControlRequestMethod.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x800000000000L) == 0) + if ((_bits & 0x8000000000000L) == 0) { - _bits |= 0x800000000000L; + _bits |= 0x8000000000000L; _headers._AccessControlRequestMethod = value; return true; } @@ -3677,9 +4020,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.AccessControlRequestHeaders, key)) { - if ((_bits & 0x1000000000000L) == 0) + if ((_bits & 0x10000000000000L) == 0) { - _bits |= 0x1000000000000L; + _bits |= 0x10000000000000L; _headers._AccessControlRequestHeaders = value; return true; } @@ -3688,9 +4031,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.AccessControlRequestHeaders.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x1000000000000L) == 0) + if ((_bits & 0x10000000000000L) == 0) { - _bits |= 0x1000000000000L; + _bits |= 0x10000000000000L; _headers._AccessControlRequestHeaders = value; return true; } @@ -3711,9 +4054,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.TE, key)) { - if ((_bits & 0x2000000000L) != 0) + if ((_bits & 0x20000000000L) != 0) { - _bits &= ~0x2000000000L; + _bits &= ~0x20000000000L; _headers._TE = default(StringValues); return true; } @@ -3722,9 +4065,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.TE.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x2000000000L) != 0) + if ((_bits & 0x20000000000L) != 0) { - _bits &= ~0x2000000000L; + _bits &= ~0x20000000000L; _headers._TE = default(StringValues); return true; } @@ -3746,9 +4089,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.DNT, key)) { - if ((_bits & 0x10000000000L) != 0) + if ((_bits & 0x100000000000L) != 0) { - _bits &= ~0x10000000000L; + _bits &= ~0x100000000000L; _headers._DNT = default(StringValues); return true; } @@ -3767,9 +4110,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.DNT.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x10000000000L) != 0) + if ((_bits & 0x100000000000L) != 0) { - _bits &= ~0x10000000000L; + _bits &= ~0x100000000000L; _headers._DNT = default(StringValues); return true; } @@ -3781,9 +4124,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.Host, key)) { - if ((_bits & 0x8000000L) != 0) + if ((_bits & 0x80000000L) != 0) { - _bits &= ~0x8000000L; + _bits &= ~0x80000000L; _headers._Host = default(StringValues); return true; } @@ -3801,9 +4144,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.From, key)) { - if ((_bits & 0x4000000L) != 0) + if ((_bits & 0x40000000L) != 0) { - _bits &= ~0x4000000L; + _bits &= ~0x40000000L; _headers._From = default(StringValues); return true; } @@ -3812,9 +4155,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.Host.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x8000000L) != 0) + if ((_bits & 0x80000000L) != 0) { - _bits &= ~0x8000000L; + _bits &= ~0x80000000L; _headers._Host = default(StringValues); return true; } @@ -3832,9 +4175,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.From.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x4000000L) != 0) + if ((_bits & 0x40000000L) != 0) { - _bits &= ~0x4000000L; + _bits &= ~0x40000000L; _headers._From = default(StringValues); return true; } @@ -3844,6 +4187,16 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } case 5: { + if (ReferenceEquals(HeaderNames.Path, key)) + { + if ((_bits & 0x200000L) != 0) + { + _bits &= ~0x200000L; + _headers._Path = default(StringValues); + return true; + } + return false; + } if (ReferenceEquals(HeaderNames.Allow, key)) { if ((_bits & 0x400L) != 0) @@ -3856,15 +4209,25 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.Range, key)) { - if ((_bits & 0x1000000000L) != 0) + if ((_bits & 0x10000000000L) != 0) { - _bits &= ~0x1000000000L; + _bits &= ~0x10000000000L; _headers._Range = default(StringValues); return true; } return false; } + if (HeaderNames.Path.Equals(key, StringComparison.OrdinalIgnoreCase)) + { + if ((_bits & 0x200000L) != 0) + { + _bits &= ~0x200000L; + _headers._Path = default(StringValues); + return true; + } + return false; + } if (HeaderNames.Allow.Equals(key, StringComparison.OrdinalIgnoreCase)) { if ((_bits & 0x400L) != 0) @@ -3877,9 +4240,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.Range.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x1000000000L) != 0) + if ((_bits & 0x10000000000L) != 0) { - _bits &= ~0x1000000000L; + _bits &= ~0x10000000000L; _headers._Range = default(StringValues); return true; } @@ -3891,9 +4254,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.Accept, key)) { - if ((_bits & 0x80000L) != 0) + if ((_bits & 0x800000L) != 0) { - _bits &= ~0x80000L; + _bits &= ~0x800000L; _headers._Accept = default(StringValues); return true; } @@ -3911,9 +4274,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.Cookie, key)) { - if ((_bits & 0x1000000L) != 0) + if ((_bits & 0x10000000L) != 0) { - _bits &= ~0x1000000L; + _bits &= ~0x10000000L; _headers._Cookie = default(StringValues); return true; } @@ -3921,9 +4284,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.Expect, key)) { - if ((_bits & 0x2000000L) != 0) + if ((_bits & 0x20000000L) != 0) { - _bits &= ~0x2000000L; + _bits &= ~0x20000000L; _headers._Expect = default(StringValues); return true; } @@ -3931,9 +4294,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.Origin, key)) { - if ((_bits & 0x400000000000L) != 0) + if ((_bits & 0x4000000000000L) != 0) { - _bits &= ~0x400000000000L; + _bits &= ~0x4000000000000L; _headers._Origin = default(StringValues); return true; } @@ -3942,9 +4305,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.Accept.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x80000L) != 0) + if ((_bits & 0x800000L) != 0) { - _bits &= ~0x80000L; + _bits &= ~0x800000L; _headers._Accept = default(StringValues); return true; } @@ -3962,9 +4325,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.Cookie.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x1000000L) != 0) + if ((_bits & 0x10000000L) != 0) { - _bits &= ~0x1000000L; + _bits &= ~0x10000000L; _headers._Cookie = default(StringValues); return true; } @@ -3972,9 +4335,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.Expect.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x2000000L) != 0) + if ((_bits & 0x20000000L) != 0) { - _bits &= ~0x2000000L; + _bits &= ~0x20000000L; _headers._Expect = default(StringValues); return true; } @@ -3982,9 +4345,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.Origin.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x400000000000L) != 0) + if ((_bits & 0x4000000000000L) != 0) { - _bits &= ~0x400000000000L; + _bits &= ~0x4000000000000L; _headers._Origin = default(StringValues); return true; } @@ -3994,6 +4357,26 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } case 7: { + if (ReferenceEquals(HeaderNames.Method, key)) + { + if ((_bits & 0x100000L) != 0) + { + _bits &= ~0x100000L; + _headers._Method = default(StringValues); + return true; + } + return false; + } + if (ReferenceEquals(HeaderNames.Scheme, key)) + { + if ((_bits & 0x400000L) != 0) + { + _bits &= ~0x400000L; + _headers._Scheme = default(StringValues); + return true; + } + return false; + } if (ReferenceEquals(HeaderNames.Trailer, key)) { if ((_bits & 0x20L) != 0) @@ -4036,15 +4419,35 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.Referer, key)) { - if ((_bits & 0x800000000L) != 0) + if ((_bits & 0x8000000000L) != 0) { - _bits &= ~0x800000000L; + _bits &= ~0x8000000000L; _headers._Referer = default(StringValues); return true; } return false; } + if (HeaderNames.Method.Equals(key, StringComparison.OrdinalIgnoreCase)) + { + if ((_bits & 0x100000L) != 0) + { + _bits &= ~0x100000L; + _headers._Method = default(StringValues); + return true; + } + return false; + } + if (HeaderNames.Scheme.Equals(key, StringComparison.OrdinalIgnoreCase)) + { + if ((_bits & 0x400000L) != 0) + { + _bits &= ~0x400000L; + _headers._Scheme = default(StringValues); + return true; + } + return false; + } if (HeaderNames.Trailer.Equals(key, StringComparison.OrdinalIgnoreCase)) { if ((_bits & 0x20L) != 0) @@ -4087,9 +4490,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.Referer.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x800000000L) != 0) + if ((_bits & 0x8000000000L) != 0) { - _bits &= ~0x800000000L; + _bits &= ~0x8000000000L; _headers._Referer = default(StringValues); return true; } @@ -4101,9 +4504,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.IfMatch, key)) { - if ((_bits & 0x10000000L) != 0) + if ((_bits & 0x100000000L) != 0) { - _bits &= ~0x10000000L; + _bits &= ~0x100000000L; _headers._IfMatch = default(StringValues); return true; } @@ -4111,9 +4514,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.IfRange, key)) { - if ((_bits & 0x80000000L) != 0) + if ((_bits & 0x800000000L) != 0) { - _bits &= ~0x80000000L; + _bits &= ~0x800000000L; _headers._IfRange = default(StringValues); return true; } @@ -4122,9 +4525,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.IfMatch.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x10000000L) != 0) + if ((_bits & 0x100000000L) != 0) { - _bits &= ~0x10000000L; + _bits &= ~0x100000000L; _headers._IfMatch = default(StringValues); return true; } @@ -4132,9 +4535,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.IfRange.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x80000000L) != 0) + if ((_bits & 0x800000000L) != 0) { - _bits &= ~0x80000000L; + _bits &= ~0x800000000L; _headers._IfRange = default(StringValues); return true; } @@ -4146,9 +4549,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.Translate, key)) { - if ((_bits & 0x4000000000L) != 0) + if ((_bits & 0x40000000000L) != 0) { - _bits &= ~0x4000000000L; + _bits &= ~0x40000000000L; _headers._Translate = default(StringValues); return true; } @@ -4157,9 +4560,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.Translate.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x4000000000L) != 0) + if ((_bits & 0x40000000000L) != 0) { - _bits &= ~0x4000000000L; + _bits &= ~0x40000000000L; _headers._Translate = default(StringValues); return true; } @@ -4179,11 +4582,21 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } return false; } + if (ReferenceEquals(HeaderNames.Authority, key)) + { + if ((_bits & 0x80000L) != 0) + { + _bits &= ~0x80000L; + _headers._Authority = default(StringValues); + return true; + } + return false; + } if (ReferenceEquals(HeaderNames.UserAgent, key)) { - if ((_bits & 0x8000000000L) != 0) + if ((_bits & 0x80000000000L) != 0) { - _bits &= ~0x8000000000L; + _bits &= ~0x80000000000L; _headers._UserAgent = default(StringValues); return true; } @@ -4201,9 +4614,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.RequestId, key)) { - if ((_bits & 0x40000000000L) != 0) + if ((_bits & 0x400000000000L) != 0) { - _bits &= ~0x40000000000L; + _bits &= ~0x400000000000L; _headers._RequestId = default(StringValues); return true; } @@ -4211,9 +4624,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.TraceState, key)) { - if ((_bits & 0x200000000000L) != 0) + if ((_bits & 0x2000000000000L) != 0) { - _bits &= ~0x200000000000L; + _bits &= ~0x2000000000000L; _headers._TraceState = default(StringValues); return true; } @@ -4230,11 +4643,21 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } return false; } + if (HeaderNames.Authority.Equals(key, StringComparison.OrdinalIgnoreCase)) + { + if ((_bits & 0x80000L) != 0) + { + _bits &= ~0x80000L; + _headers._Authority = default(StringValues); + return true; + } + return false; + } if (HeaderNames.UserAgent.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x8000000000L) != 0) + if ((_bits & 0x80000000000L) != 0) { - _bits &= ~0x8000000000L; + _bits &= ~0x80000000000L; _headers._UserAgent = default(StringValues); return true; } @@ -4252,9 +4675,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.RequestId.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x40000000000L) != 0) + if ((_bits & 0x400000000000L) != 0) { - _bits &= ~0x40000000000L; + _bits &= ~0x400000000000L; _headers._RequestId = default(StringValues); return true; } @@ -4262,9 +4685,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.TraceState.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x200000000000L) != 0) + if ((_bits & 0x2000000000000L) != 0) { - _bits &= ~0x200000000000L; + _bits &= ~0x2000000000000L; _headers._TraceState = default(StringValues); return true; } @@ -4286,9 +4709,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.TraceParent, key)) { - if ((_bits & 0x100000000000L) != 0) + if ((_bits & 0x1000000000000L) != 0) { - _bits &= ~0x100000000000L; + _bits &= ~0x1000000000000L; _headers._TraceParent = default(StringValues); return true; } @@ -4307,9 +4730,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.TraceParent.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x100000000000L) != 0) + if ((_bits & 0x1000000000000L) != 0) { - _bits &= ~0x100000000000L; + _bits &= ~0x1000000000000L; _headers._TraceParent = default(StringValues); return true; } @@ -4331,9 +4754,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.MaxForwards, key)) { - if ((_bits & 0x200000000L) != 0) + if ((_bits & 0x2000000000L) != 0) { - _bits &= ~0x200000000L; + _bits &= ~0x2000000000L; _headers._MaxForwards = default(StringValues); return true; } @@ -4352,9 +4775,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.MaxForwards.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x200000000L) != 0) + if ((_bits & 0x2000000000L) != 0) { - _bits &= ~0x200000000L; + _bits &= ~0x2000000000L; _headers._MaxForwards = default(StringValues); return true; } @@ -4396,9 +4819,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.Authorization, key)) { - if ((_bits & 0x800000L) != 0) + if ((_bits & 0x8000000L) != 0) { - _bits &= ~0x800000L; + _bits &= ~0x8000000L; _headers._Authorization = default(StringValues); return true; } @@ -4406,9 +4829,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.IfNoneMatch, key)) { - if ((_bits & 0x40000000L) != 0) + if ((_bits & 0x400000000L) != 0) { - _bits &= ~0x40000000L; + _bits &= ~0x400000000L; _headers._IfNoneMatch = default(StringValues); return true; } @@ -4447,9 +4870,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.Authorization.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x800000L) != 0) + if ((_bits & 0x8000000L) != 0) { - _bits &= ~0x800000L; + _bits &= ~0x8000000L; _headers._Authorization = default(StringValues); return true; } @@ -4457,9 +4880,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.IfNoneMatch.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x40000000L) != 0) + if ((_bits & 0x400000000L) != 0) { - _bits &= ~0x40000000L; + _bits &= ~0x400000000L; _headers._IfNoneMatch = default(StringValues); return true; } @@ -4471,9 +4894,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.AcceptCharset, key)) { - if ((_bits & 0x100000L) != 0) + if ((_bits & 0x1000000L) != 0) { - _bits &= ~0x100000L; + _bits &= ~0x1000000L; _headers._AcceptCharset = default(StringValues); return true; } @@ -4491,9 +4914,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.AcceptCharset.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x100000L) != 0) + if ((_bits & 0x1000000L) != 0) { - _bits &= ~0x100000L; + _bits &= ~0x1000000L; _headers._AcceptCharset = default(StringValues); return true; } @@ -4514,9 +4937,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.AcceptEncoding, key)) { - if ((_bits & 0x200000L) != 0) + if ((_bits & 0x2000000L) != 0) { - _bits &= ~0x200000L; + _bits &= ~0x2000000L; _headers._AcceptEncoding = default(StringValues); return true; } @@ -4524,9 +4947,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.AcceptLanguage, key)) { - if ((_bits & 0x400000L) != 0) + if ((_bits & 0x4000000L) != 0) { - _bits &= ~0x400000L; + _bits &= ~0x4000000L; _headers._AcceptLanguage = default(StringValues); return true; } @@ -4535,9 +4958,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.AcceptEncoding.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x200000L) != 0) + if ((_bits & 0x2000000L) != 0) { - _bits &= ~0x200000L; + _bits &= ~0x2000000L; _headers._AcceptEncoding = default(StringValues); return true; } @@ -4545,9 +4968,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.AcceptLanguage.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x400000L) != 0) + if ((_bits & 0x4000000L) != 0) { - _bits &= ~0x400000L; + _bits &= ~0x4000000L; _headers._AcceptLanguage = default(StringValues); return true; } @@ -4634,9 +5057,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.IfModifiedSince, key)) { - if ((_bits & 0x20000000L) != 0) + if ((_bits & 0x200000000L) != 0) { - _bits &= ~0x20000000L; + _bits &= ~0x200000000L; _headers._IfModifiedSince = default(StringValues); return true; } @@ -4655,9 +5078,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.IfModifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x20000000L) != 0) + if ((_bits & 0x200000000L) != 0) { - _bits &= ~0x20000000L; + _bits &= ~0x200000000L; _headers._IfModifiedSince = default(StringValues); return true; } @@ -4669,9 +5092,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.IfUnmodifiedSince, key)) { - if ((_bits & 0x100000000L) != 0) + if ((_bits & 0x1000000000L) != 0) { - _bits &= ~0x100000000L; + _bits &= ~0x1000000000L; _headers._IfUnmodifiedSince = default(StringValues); return true; } @@ -4679,9 +5102,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.ProxyAuthorization, key)) { - if ((_bits & 0x400000000L) != 0) + if ((_bits & 0x4000000000L) != 0) { - _bits &= ~0x400000000L; + _bits &= ~0x4000000000L; _headers._ProxyAuthorization = default(StringValues); return true; } @@ -4689,9 +5112,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (ReferenceEquals(HeaderNames.CorrelationContext, key)) { - if ((_bits & 0x80000000000L) != 0) + if ((_bits & 0x800000000000L) != 0) { - _bits &= ~0x80000000000L; + _bits &= ~0x800000000000L; _headers._CorrelationContext = default(StringValues); return true; } @@ -4700,9 +5123,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.IfUnmodifiedSince.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x100000000L) != 0) + if ((_bits & 0x1000000000L) != 0) { - _bits &= ~0x100000000L; + _bits &= ~0x1000000000L; _headers._IfUnmodifiedSince = default(StringValues); return true; } @@ -4710,9 +5133,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.ProxyAuthorization.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x400000000L) != 0) + if ((_bits & 0x4000000000L) != 0) { - _bits &= ~0x400000000L; + _bits &= ~0x4000000000L; _headers._ProxyAuthorization = default(StringValues); return true; } @@ -4720,9 +5143,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (HeaderNames.CorrelationContext.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x80000000000L) != 0) + if ((_bits & 0x800000000000L) != 0) { - _bits &= ~0x80000000000L; + _bits &= ~0x800000000000L; _headers._CorrelationContext = default(StringValues); return true; } @@ -4734,9 +5157,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.UpgradeInsecureRequests, key)) { - if ((_bits & 0x20000000000L) != 0) + if ((_bits & 0x200000000000L) != 0) { - _bits &= ~0x20000000000L; + _bits &= ~0x200000000000L; _headers._UpgradeInsecureRequests = default(StringValues); return true; } @@ -4745,9 +5168,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.UpgradeInsecureRequests.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x20000000000L) != 0) + if ((_bits & 0x200000000000L) != 0) { - _bits &= ~0x20000000000L; + _bits &= ~0x200000000000L; _headers._UpgradeInsecureRequests = default(StringValues); return true; } @@ -4759,9 +5182,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.AccessControlRequestMethod, key)) { - if ((_bits & 0x800000000000L) != 0) + if ((_bits & 0x8000000000000L) != 0) { - _bits &= ~0x800000000000L; + _bits &= ~0x8000000000000L; _headers._AccessControlRequestMethod = default(StringValues); return true; } @@ -4770,9 +5193,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.AccessControlRequestMethod.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x800000000000L) != 0) + if ((_bits & 0x8000000000000L) != 0) { - _bits &= ~0x800000000000L; + _bits &= ~0x8000000000000L; _headers._AccessControlRequestMethod = default(StringValues); return true; } @@ -4784,9 +5207,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { if (ReferenceEquals(HeaderNames.AccessControlRequestHeaders, key)) { - if ((_bits & 0x1000000000000L) != 0) + if ((_bits & 0x10000000000000L) != 0) { - _bits &= ~0x1000000000000L; + _bits &= ~0x10000000000000L; _headers._AccessControlRequestHeaders = default(StringValues); return true; } @@ -4795,9 +5218,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (HeaderNames.AccessControlRequestHeaders.Equals(key, StringComparison.OrdinalIgnoreCase)) { - if ((_bits & 0x1000000000000L) != 0) + if ((_bits & 0x10000000000000L) != 0) { - _bits &= ~0x1000000000000L; + _bits &= ~0x10000000000000L; _headers._AccessControlRequestHeaders = default(StringValues); return true; } @@ -4825,7 +5248,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((tempBits & 0x80000L) != 0) { - _headers._Accept = default; + _headers._Authority = default; if((tempBits & ~0x80000L) == 0) { return; @@ -4833,24 +5256,64 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http tempBits &= ~0x80000L; } - if ((tempBits & 0x8000000L) != 0) + if ((tempBits & 0x100000L) != 0) { - _headers._Host = default; - if((tempBits & ~0x8000000L) == 0) + _headers._Method = default; + if((tempBits & ~0x100000L) == 0) { return; } - tempBits &= ~0x8000000L; + tempBits &= ~0x100000L; } - if ((tempBits & 0x8000000000L) != 0) + if ((tempBits & 0x200000L) != 0) { - _headers._UserAgent = default; - if((tempBits & ~0x8000000000L) == 0) + _headers._Path = default; + if((tempBits & ~0x200000L) == 0) { return; } - tempBits &= ~0x8000000000L; + tempBits &= ~0x200000L; + } + + if ((tempBits & 0x400000L) != 0) + { + _headers._Scheme = default; + if((tempBits & ~0x400000L) == 0) + { + return; + } + tempBits &= ~0x400000L; + } + + if ((tempBits & 0x800000L) != 0) + { + _headers._Accept = default; + if((tempBits & ~0x800000L) == 0) + { + return; + } + tempBits &= ~0x800000L; + } + + if ((tempBits & 0x80000000L) != 0) + { + _headers._Host = default; + if((tempBits & ~0x80000000L) == 0) + { + return; + } + tempBits &= ~0x80000000L; + } + + if ((tempBits & 0x80000000000L) != 0) + { + _headers._UserAgent = default; + if((tempBits & ~0x80000000000L) == 0) + { + return; + } + tempBits &= ~0x80000000000L; } if ((tempBits & 0x1L) != 0) @@ -5033,49 +5496,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http tempBits &= ~0x40000L; } - if ((tempBits & 0x100000L) != 0) - { - _headers._AcceptCharset = default; - if((tempBits & ~0x100000L) == 0) - { - return; - } - tempBits &= ~0x100000L; - } - - if ((tempBits & 0x200000L) != 0) - { - _headers._AcceptEncoding = default; - if((tempBits & ~0x200000L) == 0) - { - return; - } - tempBits &= ~0x200000L; - } - - if ((tempBits & 0x400000L) != 0) - { - _headers._AcceptLanguage = default; - if((tempBits & ~0x400000L) == 0) - { - return; - } - tempBits &= ~0x400000L; - } - - if ((tempBits & 0x800000L) != 0) - { - _headers._Authorization = default; - if((tempBits & ~0x800000L) == 0) - { - return; - } - tempBits &= ~0x800000L; - } - if ((tempBits & 0x1000000L) != 0) { - _headers._Cookie = default; + _headers._AcceptCharset = default; if((tempBits & ~0x1000000L) == 0) { return; @@ -5085,7 +5508,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((tempBits & 0x2000000L) != 0) { - _headers._Expect = default; + _headers._AcceptEncoding = default; if((tempBits & ~0x2000000L) == 0) { return; @@ -5095,7 +5518,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((tempBits & 0x4000000L) != 0) { - _headers._From = default; + _headers._AcceptLanguage = default; if((tempBits & ~0x4000000L) == 0) { return; @@ -5103,9 +5526,19 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http tempBits &= ~0x4000000L; } + if ((tempBits & 0x8000000L) != 0) + { + _headers._Authorization = default; + if((tempBits & ~0x8000000L) == 0) + { + return; + } + tempBits &= ~0x8000000L; + } + if ((tempBits & 0x10000000L) != 0) { - _headers._IfMatch = default; + _headers._Cookie = default; if((tempBits & ~0x10000000L) == 0) { return; @@ -5115,7 +5548,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((tempBits & 0x20000000L) != 0) { - _headers._IfModifiedSince = default; + _headers._Expect = default; if((tempBits & ~0x20000000L) == 0) { return; @@ -5125,7 +5558,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((tempBits & 0x40000000L) != 0) { - _headers._IfNoneMatch = default; + _headers._From = default; if((tempBits & ~0x40000000L) == 0) { return; @@ -5133,19 +5566,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http tempBits &= ~0x40000000L; } - if ((tempBits & 0x80000000L) != 0) - { - _headers._IfRange = default; - if((tempBits & ~0x80000000L) == 0) - { - return; - } - tempBits &= ~0x80000000L; - } - if ((tempBits & 0x100000000L) != 0) { - _headers._IfUnmodifiedSince = default; + _headers._IfMatch = default; if((tempBits & ~0x100000000L) == 0) { return; @@ -5155,7 +5578,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((tempBits & 0x200000000L) != 0) { - _headers._MaxForwards = default; + _headers._IfModifiedSince = default; if((tempBits & ~0x200000000L) == 0) { return; @@ -5165,7 +5588,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((tempBits & 0x400000000L) != 0) { - _headers._ProxyAuthorization = default; + _headers._IfNoneMatch = default; if((tempBits & ~0x400000000L) == 0) { return; @@ -5175,7 +5598,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((tempBits & 0x800000000L) != 0) { - _headers._Referer = default; + _headers._IfRange = default; if((tempBits & ~0x800000000L) == 0) { return; @@ -5185,7 +5608,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((tempBits & 0x1000000000L) != 0) { - _headers._Range = default; + _headers._IfUnmodifiedSince = default; if((tempBits & ~0x1000000000L) == 0) { return; @@ -5195,7 +5618,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((tempBits & 0x2000000000L) != 0) { - _headers._TE = default; + _headers._MaxForwards = default; if((tempBits & ~0x2000000000L) == 0) { return; @@ -5205,7 +5628,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((tempBits & 0x4000000000L) != 0) { - _headers._Translate = default; + _headers._ProxyAuthorization = default; if((tempBits & ~0x4000000000L) == 0) { return; @@ -5213,9 +5636,19 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http tempBits &= ~0x4000000000L; } + if ((tempBits & 0x8000000000L) != 0) + { + _headers._Referer = default; + if((tempBits & ~0x8000000000L) == 0) + { + return; + } + tempBits &= ~0x8000000000L; + } + if ((tempBits & 0x10000000000L) != 0) { - _headers._DNT = default; + _headers._Range = default; if((tempBits & ~0x10000000000L) == 0) { return; @@ -5225,7 +5658,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((tempBits & 0x20000000000L) != 0) { - _headers._UpgradeInsecureRequests = default; + _headers._TE = default; if((tempBits & ~0x20000000000L) == 0) { return; @@ -5235,7 +5668,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((tempBits & 0x40000000000L) != 0) { - _headers._RequestId = default; + _headers._Translate = default; if((tempBits & ~0x40000000000L) == 0) { return; @@ -5243,19 +5676,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http tempBits &= ~0x40000000000L; } - if ((tempBits & 0x80000000000L) != 0) - { - _headers._CorrelationContext = default; - if((tempBits & ~0x80000000000L) == 0) - { - return; - } - tempBits &= ~0x80000000000L; - } - if ((tempBits & 0x100000000000L) != 0) { - _headers._TraceParent = default; + _headers._DNT = default; if((tempBits & ~0x100000000000L) == 0) { return; @@ -5265,7 +5688,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((tempBits & 0x200000000000L) != 0) { - _headers._TraceState = default; + _headers._UpgradeInsecureRequests = default; if((tempBits & ~0x200000000000L) == 0) { return; @@ -5275,7 +5698,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((tempBits & 0x400000000000L) != 0) { - _headers._Origin = default; + _headers._RequestId = default; if((tempBits & ~0x400000000000L) == 0) { return; @@ -5285,7 +5708,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((tempBits & 0x800000000000L) != 0) { - _headers._AccessControlRequestMethod = default; + _headers._CorrelationContext = default; if((tempBits & ~0x800000000000L) == 0) { return; @@ -5295,7 +5718,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((tempBits & 0x1000000000000L) != 0) { - _headers._AccessControlRequestHeaders = default; + _headers._TraceParent = default; if((tempBits & ~0x1000000000000L) == 0) { return; @@ -5303,6 +5726,46 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http tempBits &= ~0x1000000000000L; } + if ((tempBits & 0x2000000000000L) != 0) + { + _headers._TraceState = default; + if((tempBits & ~0x2000000000000L) == 0) + { + return; + } + tempBits &= ~0x2000000000000L; + } + + if ((tempBits & 0x4000000000000L) != 0) + { + _headers._Origin = default; + if((tempBits & ~0x4000000000000L) == 0) + { + return; + } + tempBits &= ~0x4000000000000L; + } + + if ((tempBits & 0x8000000000000L) != 0) + { + _headers._AccessControlRequestMethod = default; + if((tempBits & ~0x8000000000000L) == 0) + { + return; + } + tempBits &= ~0x8000000000000L; + } + + if ((tempBits & 0x10000000000000L) != 0) + { + _headers._AccessControlRequestHeaders = default; + if((tempBits & ~0x10000000000000L) == 0) + { + return; + } + tempBits &= ~0x10000000000000L; + } + } protected override bool CopyToFast(KeyValuePair[] array, int arrayIndex) @@ -5489,7 +5952,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.Accept, _headers._Accept); + array[arrayIndex] = new KeyValuePair(HeaderNames.Authority, _headers._Authority); ++arrayIndex; } if ((_bits & 0x100000L) != 0) @@ -5498,7 +5961,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.AcceptCharset, _headers._AcceptCharset); + array[arrayIndex] = new KeyValuePair(HeaderNames.Method, _headers._Method); ++arrayIndex; } if ((_bits & 0x200000L) != 0) @@ -5507,7 +5970,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.AcceptEncoding, _headers._AcceptEncoding); + array[arrayIndex] = new KeyValuePair(HeaderNames.Path, _headers._Path); ++arrayIndex; } if ((_bits & 0x400000L) != 0) @@ -5516,7 +5979,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.AcceptLanguage, _headers._AcceptLanguage); + array[arrayIndex] = new KeyValuePair(HeaderNames.Scheme, _headers._Scheme); ++arrayIndex; } if ((_bits & 0x800000L) != 0) @@ -5525,7 +5988,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.Authorization, _headers._Authorization); + array[arrayIndex] = new KeyValuePair(HeaderNames.Accept, _headers._Accept); ++arrayIndex; } if ((_bits & 0x1000000L) != 0) @@ -5534,7 +5997,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.Cookie, _headers._Cookie); + array[arrayIndex] = new KeyValuePair(HeaderNames.AcceptCharset, _headers._AcceptCharset); ++arrayIndex; } if ((_bits & 0x2000000L) != 0) @@ -5543,7 +6006,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.Expect, _headers._Expect); + array[arrayIndex] = new KeyValuePair(HeaderNames.AcceptEncoding, _headers._AcceptEncoding); ++arrayIndex; } if ((_bits & 0x4000000L) != 0) @@ -5552,7 +6015,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.From, _headers._From); + array[arrayIndex] = new KeyValuePair(HeaderNames.AcceptLanguage, _headers._AcceptLanguage); ++arrayIndex; } if ((_bits & 0x8000000L) != 0) @@ -5561,7 +6024,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.Host, _headers._Host); + array[arrayIndex] = new KeyValuePair(HeaderNames.Authorization, _headers._Authorization); ++arrayIndex; } if ((_bits & 0x10000000L) != 0) @@ -5570,7 +6033,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.IfMatch, _headers._IfMatch); + array[arrayIndex] = new KeyValuePair(HeaderNames.Cookie, _headers._Cookie); ++arrayIndex; } if ((_bits & 0x20000000L) != 0) @@ -5579,7 +6042,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.IfModifiedSince, _headers._IfModifiedSince); + array[arrayIndex] = new KeyValuePair(HeaderNames.Expect, _headers._Expect); ++arrayIndex; } if ((_bits & 0x40000000L) != 0) @@ -5588,7 +6051,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.IfNoneMatch, _headers._IfNoneMatch); + array[arrayIndex] = new KeyValuePair(HeaderNames.From, _headers._From); ++arrayIndex; } if ((_bits & 0x80000000L) != 0) @@ -5597,7 +6060,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.IfRange, _headers._IfRange); + array[arrayIndex] = new KeyValuePair(HeaderNames.Host, _headers._Host); ++arrayIndex; } if ((_bits & 0x100000000L) != 0) @@ -5606,7 +6069,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.IfUnmodifiedSince, _headers._IfUnmodifiedSince); + array[arrayIndex] = new KeyValuePair(HeaderNames.IfMatch, _headers._IfMatch); ++arrayIndex; } if ((_bits & 0x200000000L) != 0) @@ -5615,7 +6078,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.MaxForwards, _headers._MaxForwards); + array[arrayIndex] = new KeyValuePair(HeaderNames.IfModifiedSince, _headers._IfModifiedSince); ++arrayIndex; } if ((_bits & 0x400000000L) != 0) @@ -5624,7 +6087,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.ProxyAuthorization, _headers._ProxyAuthorization); + array[arrayIndex] = new KeyValuePair(HeaderNames.IfNoneMatch, _headers._IfNoneMatch); ++arrayIndex; } if ((_bits & 0x800000000L) != 0) @@ -5633,7 +6096,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.Referer, _headers._Referer); + array[arrayIndex] = new KeyValuePair(HeaderNames.IfRange, _headers._IfRange); ++arrayIndex; } if ((_bits & 0x1000000000L) != 0) @@ -5642,7 +6105,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.Range, _headers._Range); + array[arrayIndex] = new KeyValuePair(HeaderNames.IfUnmodifiedSince, _headers._IfUnmodifiedSince); ++arrayIndex; } if ((_bits & 0x2000000000L) != 0) @@ -5651,7 +6114,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.TE, _headers._TE); + array[arrayIndex] = new KeyValuePair(HeaderNames.MaxForwards, _headers._MaxForwards); ++arrayIndex; } if ((_bits & 0x4000000000L) != 0) @@ -5660,7 +6123,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.Translate, _headers._Translate); + array[arrayIndex] = new KeyValuePair(HeaderNames.ProxyAuthorization, _headers._ProxyAuthorization); ++arrayIndex; } if ((_bits & 0x8000000000L) != 0) @@ -5669,7 +6132,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.UserAgent, _headers._UserAgent); + array[arrayIndex] = new KeyValuePair(HeaderNames.Referer, _headers._Referer); ++arrayIndex; } if ((_bits & 0x10000000000L) != 0) @@ -5678,7 +6141,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.DNT, _headers._DNT); + array[arrayIndex] = new KeyValuePair(HeaderNames.Range, _headers._Range); ++arrayIndex; } if ((_bits & 0x20000000000L) != 0) @@ -5687,7 +6150,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.UpgradeInsecureRequests, _headers._UpgradeInsecureRequests); + array[arrayIndex] = new KeyValuePair(HeaderNames.TE, _headers._TE); ++arrayIndex; } if ((_bits & 0x40000000000L) != 0) @@ -5696,7 +6159,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.RequestId, _headers._RequestId); + array[arrayIndex] = new KeyValuePair(HeaderNames.Translate, _headers._Translate); ++arrayIndex; } if ((_bits & 0x80000000000L) != 0) @@ -5705,7 +6168,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.CorrelationContext, _headers._CorrelationContext); + array[arrayIndex] = new KeyValuePair(HeaderNames.UserAgent, _headers._UserAgent); ++arrayIndex; } if ((_bits & 0x100000000000L) != 0) @@ -5714,7 +6177,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.TraceParent, _headers._TraceParent); + array[arrayIndex] = new KeyValuePair(HeaderNames.DNT, _headers._DNT); ++arrayIndex; } if ((_bits & 0x200000000000L) != 0) @@ -5723,7 +6186,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.TraceState, _headers._TraceState); + array[arrayIndex] = new KeyValuePair(HeaderNames.UpgradeInsecureRequests, _headers._UpgradeInsecureRequests); ++arrayIndex; } if ((_bits & 0x400000000000L) != 0) @@ -5732,7 +6195,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.Origin, _headers._Origin); + array[arrayIndex] = new KeyValuePair(HeaderNames.RequestId, _headers._RequestId); ++arrayIndex; } if ((_bits & 0x800000000000L) != 0) @@ -5741,10 +6204,46 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { return false; } - array[arrayIndex] = new KeyValuePair(HeaderNames.AccessControlRequestMethod, _headers._AccessControlRequestMethod); + array[arrayIndex] = new KeyValuePair(HeaderNames.CorrelationContext, _headers._CorrelationContext); ++arrayIndex; } if ((_bits & 0x1000000000000L) != 0) + { + if (arrayIndex == array.Length) + { + return false; + } + array[arrayIndex] = new KeyValuePair(HeaderNames.TraceParent, _headers._TraceParent); + ++arrayIndex; + } + if ((_bits & 0x2000000000000L) != 0) + { + if (arrayIndex == array.Length) + { + return false; + } + array[arrayIndex] = new KeyValuePair(HeaderNames.TraceState, _headers._TraceState); + ++arrayIndex; + } + if ((_bits & 0x4000000000000L) != 0) + { + if (arrayIndex == array.Length) + { + return false; + } + array[arrayIndex] = new KeyValuePair(HeaderNames.Origin, _headers._Origin); + ++arrayIndex; + } + if ((_bits & 0x8000000000000L) != 0) + { + if (arrayIndex == array.Length) + { + return false; + } + array[arrayIndex] = new KeyValuePair(HeaderNames.AccessControlRequestMethod, _headers._AccessControlRequestMethod); + ++arrayIndex; + } + if ((_bits & 0x10000000000000L) != 0) { if (arrayIndex == array.Length) { @@ -5780,7 +6279,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http case 2: if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfu) == 0x4554u)) { - flag = 0x2000000000L; + flag = 0x20000000000L; values = ref _headers._TE; } break; @@ -5788,7 +6287,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http var firstTerm3 = (Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfu); if ((firstTerm3 == 0x4e44u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)2) & 0xdfu) == 0x54u)) { - flag = 0x10000000000L; + flag = 0x100000000000L; values = ref _headers._DNT; } else if ((firstTerm3 == 0x4956u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)2) & 0xdfu) == 0x41u)) @@ -5801,7 +6300,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http var firstTerm4 = (Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfu); if ((firstTerm4 == 0x54534f48u)) { - flag = 0x8000000L; + flag = 0x80000000L; values = ref _headers._Host; } else if ((firstTerm4 == 0x45544144u)) @@ -5811,20 +6310,24 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } else if ((firstTerm4 == 0x4d4f5246u)) { - flag = 0x4000000L; + flag = 0x40000000L; values = ref _headers._From; } break; case 5: - var firstTerm5 = (Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfu); - if ((firstTerm5 == 0x4f4c4c41u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)4) & 0xdfu) == 0x57u)) + if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfffu) == 0x5441503au) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)4) & 0xdfu) == 0x48u)) + { + flag = 0x200000L; + values = ref _headers._Path; + } + else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfu) == 0x4f4c4c41u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)4) & 0xdfu) == 0x57u)) { flag = 0x400L; values = ref _headers._Allow; } - else if ((firstTerm5 == 0x474e4152u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)4) & 0xdfu) == 0x45u)) + else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfu) == 0x474e4152u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)4) & 0xdfu) == 0x45u)) { - flag = 0x1000000000L; + flag = 0x10000000000L; values = ref _headers._Range; } break; @@ -5832,22 +6335,22 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http var firstTerm6 = (Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfu); if ((firstTerm6 == 0x45434341u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x5450u)) { - flag = 0x80000L; + flag = 0x800000L; values = ref _headers._Accept; } else if ((firstTerm6 == 0x4b4f4f43u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4549u)) { - flag = 0x1000000L; + flag = 0x10000000L; values = ref _headers._Cookie; } else if ((firstTerm6 == 0x45505845u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x5443u)) { - flag = 0x2000000L; + flag = 0x20000000L; values = ref _headers._Expect; } else if ((firstTerm6 == 0x4749524fu) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4e49u)) { - flag = 0x400000000000L; + flag = 0x4000000000000L; values = ref _headers._Origin; } else if ((firstTerm6 == 0x47415250u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x414du)) @@ -5857,28 +6360,37 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } break; case 7: - var firstTerm7 = (Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfu); - if ((firstTerm7 == 0x49505845u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4552u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x53u)) + if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfffu) == 0x54454d3au) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4f48u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x44u)) + { + flag = 0x100000L; + values = ref _headers._Method; + } + else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfffu) == 0x4843533au) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4d45u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x45u)) + { + flag = 0x400000L; + values = ref _headers._Scheme; + } + else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfu) == 0x49505845u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4552u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x53u)) { flag = 0x20000L; values = ref _headers._Expires; } - else if ((firstTerm7 == 0x45464552u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4552u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x52u)) + else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfu) == 0x45464552u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4552u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x52u)) { - flag = 0x800000000L; + flag = 0x8000000000L; values = ref _headers._Referer; } - else if ((firstTerm7 == 0x49415254u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x454cu) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x52u)) + else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfu) == 0x49415254u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x454cu) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x52u)) { flag = 0x20L; values = ref _headers._Trailer; } - else if ((firstTerm7 == 0x52475055u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4441u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x45u)) + else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfu) == 0x52475055u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4441u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x45u)) { flag = 0x80L; values = ref _headers._Upgrade; } - else if ((firstTerm7 == 0x4e524157u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4e49u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x47u)) + else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfu) == 0x4e524157u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ushort)))) & 0xdfdfu) == 0x4e49u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)6) & 0xdfu) == 0x47u)) { flag = 0x200L; values = ref _headers._Warning; @@ -5888,31 +6400,36 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http var firstTerm8 = (Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfdfffdfdfuL); if ((firstTerm8 == 0x484354414d2d4649uL)) { - flag = 0x10000000L; + flag = 0x100000000L; values = ref _headers._IfMatch; } else if ((firstTerm8 == 0x45474e41522d4649uL)) { - flag = 0x80000000L; + flag = 0x800000000L; values = ref _headers._IfRange; } break; case 9: if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfdfdfdfdfuL) == 0x54414c534e415254uL) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)8) & 0xdfu) == 0x45u)) { - flag = 0x4000000000L; + flag = 0x40000000000L; values = ref _headers._Translate; } break; case 10: - if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfdfdfdfdfuL) == 0x495443454e4e4f43uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(4 * sizeof(ushort)))) & 0xdfdfu) == 0x4e4fu)) + if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfdfdfdfffuL) == 0x49524f485455413auL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(4 * sizeof(ushort)))) & 0xdfdfu) == 0x5954u)) + { + flag = 0x80000L; + values = ref _headers._Authority; + } + else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfdfdfdfdfuL) == 0x495443454e4e4f43uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(4 * sizeof(ushort)))) & 0xdfdfu) == 0x4e4fu)) { flag = 0x2L; values = ref _headers._Connection; } else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfffdfdfdfdfuL) == 0x4547412d52455355uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(4 * sizeof(ushort)))) & 0xdfdfu) == 0x544eu)) { - flag = 0x8000000000L; + flag = 0x80000000000L; values = ref _headers._UserAgent; } else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfffdfdfdfdfuL) == 0x494c412d5045454buL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(4 * sizeof(ushort)))) & 0xdfdfu) == 0x4556u)) @@ -5922,12 +6439,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xffdfdfdfdfdfdfdfuL) == 0x2d54534555514552uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(4 * sizeof(ushort)))) & 0xdfdfu) == 0x4449u)) { - flag = 0x40000000000L; + flag = 0x400000000000L; values = ref _headers._RequestId; } else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfdfdfdfdfuL) == 0x4154534543415254uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(4 * sizeof(ushort)))) & 0xdfdfu) == 0x4554u)) { - flag = 0x200000000000L; + flag = 0x2000000000000L; values = ref _headers._TraceState; } break; @@ -5939,7 +6456,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfdfdfdfdfuL) == 0x5241504543415254uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(4 * sizeof(ushort)))) & 0xdfdfu) == 0x4e45u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)10) & 0xdfu) == 0x54u)) { - flag = 0x100000000000L; + flag = 0x1000000000000L; values = ref _headers._TraceParent; } break; @@ -5951,14 +6468,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfffdfdfdfuL) == 0x57524f462d58414duL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x53445241u)) { - flag = 0x200000000L; + flag = 0x2000000000L; values = ref _headers._MaxForwards; } break; case 13: if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfdfdfdfdfuL) == 0x5a49524f48545541uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x4f495441u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)12) & 0xdfu) == 0x4eu)) { - flag = 0x800000L; + flag = 0x8000000L; values = ref _headers._Authorization; } else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfffdfdfdfdfdfuL) == 0x4f432d4548434143uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x4f52544eu) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)12) & 0xdfu) == 0x4cu)) @@ -5973,7 +6490,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xffdfdfdfdfffdfdfuL) == 0x2d454e4f4e2d4649uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x4354414du) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)12) & 0xdfu) == 0x48u)) { - flag = 0x40000000L; + flag = 0x400000000L; values = ref _headers._IfNoneMatch; } else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfffdfdfdfdfuL) == 0x444f4d2d5453414cuL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x45494649u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)12) & 0xdfu) == 0x44u)) @@ -5985,7 +6502,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http case 14: if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfffdfdfdfdfdfdfuL) == 0x432d545045434341uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x53524148u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(6 * sizeof(ushort)))) & 0xdfdfu) == 0x5445u)) { - flag = 0x100000L; + flag = 0x1000000L; values = ref _headers._AcceptCharset; } else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xffdfdfdfdfdfdfdfuL) == 0x2d544e45544e4f43uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x474e454cu) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(6 * sizeof(ushort)))) & 0xdfdfu) == 0x4854u)) @@ -5998,12 +6515,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http var firstTerm15 = (Unsafe.ReadUnaligned(ref nameStart) & 0xdfffdfdfdfdfdfdfuL); if ((firstTerm15 == 0x452d545045434341uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x444f434eu) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(6 * sizeof(ushort)))) & 0xdfdfu) == 0x4e49u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)14) & 0xdfu) == 0x47u)) { - flag = 0x200000L; + flag = 0x2000000L; values = ref _headers._AcceptEncoding; } else if ((firstTerm15 == 0x4c2d545045434341uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x55474e41u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(6 * sizeof(ushort)))) & 0xdfdfu) == 0x4741u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)14) & 0xdfu) == 0x45u)) { - flag = 0x400000L; + flag = 0x4000000L; values = ref _headers._AcceptLanguage; } break; @@ -6031,7 +6548,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http case 17: if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfdfffdfdfuL) == 0x4649444f4d2d4649uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfdfdfdfffdfdfdfuL) == 0x434e49532d444549uL) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)16) & 0xdfu) == 0x45u)) { - flag = 0x20000000L; + flag = 0x200000000L; values = ref _headers._IfModifiedSince; } else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfdfdfdfdfuL) == 0x524546534e415254uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfdfdfdfdfdfdfffuL) == 0x4e49444f434e452duL) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)16) & 0xdfu) == 0x47u)) @@ -6043,38 +6560,38 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http case 19: if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfdfdfdfdfuL) == 0x54414c4552524f43uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfdfdfdfffdfdfdfuL) == 0x544e4f432d4e4f49uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(8 * sizeof(ushort)))) & 0xdfdfu) == 0x5845u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)18) & 0xdfu) == 0x54u)) { - flag = 0x80000000000L; + flag = 0x800000000000L; values = ref _headers._CorrelationContext; } else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfdfdfdfffdfdfuL) == 0x444f4d4e552d4649uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfdfffdfdfdfdfdfuL) == 0x49532d4445494649uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(8 * sizeof(ushort)))) & 0xdfdfu) == 0x434eu) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)18) & 0xdfu) == 0x45u)) { - flag = 0x100000000L; + flag = 0x1000000000L; values = ref _headers._IfUnmodifiedSince; } else if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfdfffdfdfdfdfdfuL) == 0x55412d59584f5250uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfdfdfdfdfdfdfdfuL) == 0x54415a49524f4854uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(8 * sizeof(ushort)))) & 0xdfdfu) == 0x4f49u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)18) & 0xdfu) == 0x4eu)) { - flag = 0x400000000L; + flag = 0x4000000000L; values = ref _headers._ProxyAuthorization; } break; case 25: if (((Unsafe.ReadUnaligned(ref nameStart) & 0xffdfdfdfdfdfdfdfuL) == 0x2d45444152475055uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfdfdfdfdfdfdfdfuL) == 0x4552554345534e49uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ulong)))) & 0xdfdfdfdfdfdfdfffuL) == 0x545345555145522duL) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)24) & 0xdfu) == 0x53u)) { - flag = 0x20000000000L; + flag = 0x200000000000L; values = ref _headers._UpgradeInsecureRequests; } break; case 29: if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfffdfdfdfdfdfdfuL) == 0x432d535345434341uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfffdfdfdfdfdfdfuL) == 0x522d4c4f52544e4fuL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ulong)))) & 0xdfffdfdfdfdfdfdfuL) == 0x4d2d545345555145uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(6 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x4f485445u) && ((Unsafe.AddByteOffset(ref nameStart, (IntPtr)28) & 0xdfu) == 0x44u)) { - flag = 0x800000000000L; + flag = 0x8000000000000L; values = ref _headers._AccessControlRequestMethod; } break; case 30: if (((Unsafe.ReadUnaligned(ref nameStart) & 0xdfffdfdfdfdfdfdfuL) == 0x432d535345434341uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof(ulong))) & 0xdfffdfdfdfdfdfdfuL) == 0x522d4c4f52544e4fuL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(2 * sizeof(ulong)))) & 0xdfffdfdfdfdfdfdfuL) == 0x482d545345555145uL) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(6 * sizeof(uint)))) & 0xdfdfdfdfu) == 0x45444145u) && ((Unsafe.ReadUnaligned(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)(14 * sizeof(ushort)))) & 0xdfdfu) == 0x5352u)) { - flag = 0x1000000000000L; + flag = 0x10000000000000L; values = ref _headers._AccessControlRequestHeaders; } break; @@ -6149,6 +6666,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http public StringValues _ContentRange; public StringValues _Expires; public StringValues _LastModified; + public StringValues _Authority; + public StringValues _Method; + public StringValues _Path; + public StringValues _Scheme; public StringValues _Accept; public StringValues _AcceptCharset; public StringValues _AcceptEncoding; @@ -6228,66 +6749,74 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http case 18: goto HeaderLastModified; case 19: - goto HeaderAccept; + goto HeaderAuthority; case 20: - goto HeaderAcceptCharset; + goto HeaderMethod; case 21: - goto HeaderAcceptEncoding; + goto HeaderPath; case 22: - goto HeaderAcceptLanguage; + goto HeaderScheme; case 23: - goto HeaderAuthorization; + goto HeaderAccept; case 24: - goto HeaderCookie; + goto HeaderAcceptCharset; case 25: - goto HeaderExpect; + goto HeaderAcceptEncoding; case 26: - goto HeaderFrom; + goto HeaderAcceptLanguage; case 27: - goto HeaderHost; + goto HeaderAuthorization; case 28: - goto HeaderIfMatch; + goto HeaderCookie; case 29: - goto HeaderIfModifiedSince; + goto HeaderExpect; case 30: - goto HeaderIfNoneMatch; + goto HeaderFrom; case 31: - goto HeaderIfRange; + goto HeaderHost; case 32: - goto HeaderIfUnmodifiedSince; + goto HeaderIfMatch; case 33: - goto HeaderMaxForwards; + goto HeaderIfModifiedSince; case 34: - goto HeaderProxyAuthorization; + goto HeaderIfNoneMatch; case 35: - goto HeaderReferer; + goto HeaderIfRange; case 36: - goto HeaderRange; + goto HeaderIfUnmodifiedSince; case 37: - goto HeaderTE; + goto HeaderMaxForwards; case 38: - goto HeaderTranslate; + goto HeaderProxyAuthorization; case 39: - goto HeaderUserAgent; + goto HeaderReferer; case 40: - goto HeaderDNT; + goto HeaderRange; case 41: - goto HeaderUpgradeInsecureRequests; + goto HeaderTE; case 42: - goto HeaderRequestId; + goto HeaderTranslate; case 43: - goto HeaderCorrelationContext; + goto HeaderUserAgent; case 44: - goto HeaderTraceParent; + goto HeaderDNT; case 45: - goto HeaderTraceState; + goto HeaderUpgradeInsecureRequests; case 46: - goto HeaderOrigin; + goto HeaderRequestId; case 47: - goto HeaderAccessControlRequestMethod; + goto HeaderCorrelationContext; case 48: - goto HeaderAccessControlRequestHeaders; + goto HeaderTraceParent; case 49: + goto HeaderTraceState; + case 50: + goto HeaderOrigin; + case 51: + goto HeaderAccessControlRequestMethod; + case 52: + goto HeaderAccessControlRequestHeaders; + case 53: goto HeaderContentLength; default: goto ExtraHeaders; @@ -6297,6 +6826,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x1L) != 0) { _current = new KeyValuePair(HeaderNames.CacheControl, _collection._headers._CacheControl); + _currentKnownType = KnownHeaderType.CacheControl; _next = 1; return true; } @@ -6304,6 +6834,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x2L) != 0) { _current = new KeyValuePair(HeaderNames.Connection, _collection._headers._Connection); + _currentKnownType = KnownHeaderType.Connection; _next = 2; return true; } @@ -6311,6 +6842,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x4L) != 0) { _current = new KeyValuePair(HeaderNames.Date, _collection._headers._Date); + _currentKnownType = KnownHeaderType.Date; _next = 3; return true; } @@ -6318,6 +6850,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x8L) != 0) { _current = new KeyValuePair(HeaderNames.KeepAlive, _collection._headers._KeepAlive); + _currentKnownType = KnownHeaderType.KeepAlive; _next = 4; return true; } @@ -6325,6 +6858,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x10L) != 0) { _current = new KeyValuePair(HeaderNames.Pragma, _collection._headers._Pragma); + _currentKnownType = KnownHeaderType.Pragma; _next = 5; return true; } @@ -6332,6 +6866,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x20L) != 0) { _current = new KeyValuePair(HeaderNames.Trailer, _collection._headers._Trailer); + _currentKnownType = KnownHeaderType.Trailer; _next = 6; return true; } @@ -6339,6 +6874,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x40L) != 0) { _current = new KeyValuePair(HeaderNames.TransferEncoding, _collection._headers._TransferEncoding); + _currentKnownType = KnownHeaderType.TransferEncoding; _next = 7; return true; } @@ -6346,6 +6882,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x80L) != 0) { _current = new KeyValuePair(HeaderNames.Upgrade, _collection._headers._Upgrade); + _currentKnownType = KnownHeaderType.Upgrade; _next = 8; return true; } @@ -6353,6 +6890,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x100L) != 0) { _current = new KeyValuePair(HeaderNames.Via, _collection._headers._Via); + _currentKnownType = KnownHeaderType.Via; _next = 9; return true; } @@ -6360,6 +6898,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x200L) != 0) { _current = new KeyValuePair(HeaderNames.Warning, _collection._headers._Warning); + _currentKnownType = KnownHeaderType.Warning; _next = 10; return true; } @@ -6367,6 +6906,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x400L) != 0) { _current = new KeyValuePair(HeaderNames.Allow, _collection._headers._Allow); + _currentKnownType = KnownHeaderType.Allow; _next = 11; return true; } @@ -6374,6 +6914,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x800L) != 0) { _current = new KeyValuePair(HeaderNames.ContentType, _collection._headers._ContentType); + _currentKnownType = KnownHeaderType.ContentType; _next = 12; return true; } @@ -6381,6 +6922,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x1000L) != 0) { _current = new KeyValuePair(HeaderNames.ContentEncoding, _collection._headers._ContentEncoding); + _currentKnownType = KnownHeaderType.ContentEncoding; _next = 13; return true; } @@ -6388,6 +6930,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x2000L) != 0) { _current = new KeyValuePair(HeaderNames.ContentLanguage, _collection._headers._ContentLanguage); + _currentKnownType = KnownHeaderType.ContentLanguage; _next = 14; return true; } @@ -6395,6 +6938,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x4000L) != 0) { _current = new KeyValuePair(HeaderNames.ContentLocation, _collection._headers._ContentLocation); + _currentKnownType = KnownHeaderType.ContentLocation; _next = 15; return true; } @@ -6402,6 +6946,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x8000L) != 0) { _current = new KeyValuePair(HeaderNames.ContentMD5, _collection._headers._ContentMD5); + _currentKnownType = KnownHeaderType.ContentMD5; _next = 16; return true; } @@ -6409,6 +6954,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x10000L) != 0) { _current = new KeyValuePair(HeaderNames.ContentRange, _collection._headers._ContentRange); + _currentKnownType = KnownHeaderType.ContentRange; _next = 17; return true; } @@ -6416,6 +6962,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x20000L) != 0) { _current = new KeyValuePair(HeaderNames.Expires, _collection._headers._Expires); + _currentKnownType = KnownHeaderType.Expires; _next = 18; return true; } @@ -6423,233 +6970,299 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x40000L) != 0) { _current = new KeyValuePair(HeaderNames.LastModified, _collection._headers._LastModified); + _currentKnownType = KnownHeaderType.LastModified; _next = 19; return true; } - HeaderAccept: // case 19 + HeaderAuthority: // case 19 if ((_bits & 0x80000L) != 0) { - _current = new KeyValuePair(HeaderNames.Accept, _collection._headers._Accept); + _current = new KeyValuePair(HeaderNames.Authority, _collection._headers._Authority); + _currentKnownType = KnownHeaderType.Authority; _next = 20; return true; } - HeaderAcceptCharset: // case 20 + HeaderMethod: // case 20 if ((_bits & 0x100000L) != 0) { - _current = new KeyValuePair(HeaderNames.AcceptCharset, _collection._headers._AcceptCharset); + _current = new KeyValuePair(HeaderNames.Method, _collection._headers._Method); + _currentKnownType = KnownHeaderType.Method; _next = 21; return true; } - HeaderAcceptEncoding: // case 21 + HeaderPath: // case 21 if ((_bits & 0x200000L) != 0) { - _current = new KeyValuePair(HeaderNames.AcceptEncoding, _collection._headers._AcceptEncoding); + _current = new KeyValuePair(HeaderNames.Path, _collection._headers._Path); + _currentKnownType = KnownHeaderType.Path; _next = 22; return true; } - HeaderAcceptLanguage: // case 22 + HeaderScheme: // case 22 if ((_bits & 0x400000L) != 0) { - _current = new KeyValuePair(HeaderNames.AcceptLanguage, _collection._headers._AcceptLanguage); + _current = new KeyValuePair(HeaderNames.Scheme, _collection._headers._Scheme); + _currentKnownType = KnownHeaderType.Scheme; _next = 23; return true; } - HeaderAuthorization: // case 23 + HeaderAccept: // case 23 if ((_bits & 0x800000L) != 0) { - _current = new KeyValuePair(HeaderNames.Authorization, _collection._headers._Authorization); + _current = new KeyValuePair(HeaderNames.Accept, _collection._headers._Accept); + _currentKnownType = KnownHeaderType.Accept; _next = 24; return true; } - HeaderCookie: // case 24 + HeaderAcceptCharset: // case 24 if ((_bits & 0x1000000L) != 0) { - _current = new KeyValuePair(HeaderNames.Cookie, _collection._headers._Cookie); + _current = new KeyValuePair(HeaderNames.AcceptCharset, _collection._headers._AcceptCharset); + _currentKnownType = KnownHeaderType.AcceptCharset; _next = 25; return true; } - HeaderExpect: // case 25 + HeaderAcceptEncoding: // case 25 if ((_bits & 0x2000000L) != 0) { - _current = new KeyValuePair(HeaderNames.Expect, _collection._headers._Expect); + _current = new KeyValuePair(HeaderNames.AcceptEncoding, _collection._headers._AcceptEncoding); + _currentKnownType = KnownHeaderType.AcceptEncoding; _next = 26; return true; } - HeaderFrom: // case 26 + HeaderAcceptLanguage: // case 26 if ((_bits & 0x4000000L) != 0) { - _current = new KeyValuePair(HeaderNames.From, _collection._headers._From); + _current = new KeyValuePair(HeaderNames.AcceptLanguage, _collection._headers._AcceptLanguage); + _currentKnownType = KnownHeaderType.AcceptLanguage; _next = 27; return true; } - HeaderHost: // case 27 + HeaderAuthorization: // case 27 if ((_bits & 0x8000000L) != 0) { - _current = new KeyValuePair(HeaderNames.Host, _collection._headers._Host); + _current = new KeyValuePair(HeaderNames.Authorization, _collection._headers._Authorization); + _currentKnownType = KnownHeaderType.Authorization; _next = 28; return true; } - HeaderIfMatch: // case 28 + HeaderCookie: // case 28 if ((_bits & 0x10000000L) != 0) { - _current = new KeyValuePair(HeaderNames.IfMatch, _collection._headers._IfMatch); + _current = new KeyValuePair(HeaderNames.Cookie, _collection._headers._Cookie); + _currentKnownType = KnownHeaderType.Cookie; _next = 29; return true; } - HeaderIfModifiedSince: // case 29 + HeaderExpect: // case 29 if ((_bits & 0x20000000L) != 0) { - _current = new KeyValuePair(HeaderNames.IfModifiedSince, _collection._headers._IfModifiedSince); + _current = new KeyValuePair(HeaderNames.Expect, _collection._headers._Expect); + _currentKnownType = KnownHeaderType.Expect; _next = 30; return true; } - HeaderIfNoneMatch: // case 30 + HeaderFrom: // case 30 if ((_bits & 0x40000000L) != 0) { - _current = new KeyValuePair(HeaderNames.IfNoneMatch, _collection._headers._IfNoneMatch); + _current = new KeyValuePair(HeaderNames.From, _collection._headers._From); + _currentKnownType = KnownHeaderType.From; _next = 31; return true; } - HeaderIfRange: // case 31 + HeaderHost: // case 31 if ((_bits & 0x80000000L) != 0) { - _current = new KeyValuePair(HeaderNames.IfRange, _collection._headers._IfRange); + _current = new KeyValuePair(HeaderNames.Host, _collection._headers._Host); + _currentKnownType = KnownHeaderType.Host; _next = 32; return true; } - HeaderIfUnmodifiedSince: // case 32 + HeaderIfMatch: // case 32 if ((_bits & 0x100000000L) != 0) { - _current = new KeyValuePair(HeaderNames.IfUnmodifiedSince, _collection._headers._IfUnmodifiedSince); + _current = new KeyValuePair(HeaderNames.IfMatch, _collection._headers._IfMatch); + _currentKnownType = KnownHeaderType.IfMatch; _next = 33; return true; } - HeaderMaxForwards: // case 33 + HeaderIfModifiedSince: // case 33 if ((_bits & 0x200000000L) != 0) { - _current = new KeyValuePair(HeaderNames.MaxForwards, _collection._headers._MaxForwards); + _current = new KeyValuePair(HeaderNames.IfModifiedSince, _collection._headers._IfModifiedSince); + _currentKnownType = KnownHeaderType.IfModifiedSince; _next = 34; return true; } - HeaderProxyAuthorization: // case 34 + HeaderIfNoneMatch: // case 34 if ((_bits & 0x400000000L) != 0) { - _current = new KeyValuePair(HeaderNames.ProxyAuthorization, _collection._headers._ProxyAuthorization); + _current = new KeyValuePair(HeaderNames.IfNoneMatch, _collection._headers._IfNoneMatch); + _currentKnownType = KnownHeaderType.IfNoneMatch; _next = 35; return true; } - HeaderReferer: // case 35 + HeaderIfRange: // case 35 if ((_bits & 0x800000000L) != 0) { - _current = new KeyValuePair(HeaderNames.Referer, _collection._headers._Referer); + _current = new KeyValuePair(HeaderNames.IfRange, _collection._headers._IfRange); + _currentKnownType = KnownHeaderType.IfRange; _next = 36; return true; } - HeaderRange: // case 36 + HeaderIfUnmodifiedSince: // case 36 if ((_bits & 0x1000000000L) != 0) { - _current = new KeyValuePair(HeaderNames.Range, _collection._headers._Range); + _current = new KeyValuePair(HeaderNames.IfUnmodifiedSince, _collection._headers._IfUnmodifiedSince); + _currentKnownType = KnownHeaderType.IfUnmodifiedSince; _next = 37; return true; } - HeaderTE: // case 37 + HeaderMaxForwards: // case 37 if ((_bits & 0x2000000000L) != 0) { - _current = new KeyValuePair(HeaderNames.TE, _collection._headers._TE); + _current = new KeyValuePair(HeaderNames.MaxForwards, _collection._headers._MaxForwards); + _currentKnownType = KnownHeaderType.MaxForwards; _next = 38; return true; } - HeaderTranslate: // case 38 + HeaderProxyAuthorization: // case 38 if ((_bits & 0x4000000000L) != 0) { - _current = new KeyValuePair(HeaderNames.Translate, _collection._headers._Translate); + _current = new KeyValuePair(HeaderNames.ProxyAuthorization, _collection._headers._ProxyAuthorization); + _currentKnownType = KnownHeaderType.ProxyAuthorization; _next = 39; return true; } - HeaderUserAgent: // case 39 + HeaderReferer: // case 39 if ((_bits & 0x8000000000L) != 0) { - _current = new KeyValuePair(HeaderNames.UserAgent, _collection._headers._UserAgent); + _current = new KeyValuePair(HeaderNames.Referer, _collection._headers._Referer); + _currentKnownType = KnownHeaderType.Referer; _next = 40; return true; } - HeaderDNT: // case 40 + HeaderRange: // case 40 if ((_bits & 0x10000000000L) != 0) { - _current = new KeyValuePair(HeaderNames.DNT, _collection._headers._DNT); + _current = new KeyValuePair(HeaderNames.Range, _collection._headers._Range); + _currentKnownType = KnownHeaderType.Range; _next = 41; return true; } - HeaderUpgradeInsecureRequests: // case 41 + HeaderTE: // case 41 if ((_bits & 0x20000000000L) != 0) { - _current = new KeyValuePair(HeaderNames.UpgradeInsecureRequests, _collection._headers._UpgradeInsecureRequests); + _current = new KeyValuePair(HeaderNames.TE, _collection._headers._TE); + _currentKnownType = KnownHeaderType.TE; _next = 42; return true; } - HeaderRequestId: // case 42 + HeaderTranslate: // case 42 if ((_bits & 0x40000000000L) != 0) { - _current = new KeyValuePair(HeaderNames.RequestId, _collection._headers._RequestId); + _current = new KeyValuePair(HeaderNames.Translate, _collection._headers._Translate); + _currentKnownType = KnownHeaderType.Translate; _next = 43; return true; } - HeaderCorrelationContext: // case 43 + HeaderUserAgent: // case 43 if ((_bits & 0x80000000000L) != 0) { - _current = new KeyValuePair(HeaderNames.CorrelationContext, _collection._headers._CorrelationContext); + _current = new KeyValuePair(HeaderNames.UserAgent, _collection._headers._UserAgent); + _currentKnownType = KnownHeaderType.UserAgent; _next = 44; return true; } - HeaderTraceParent: // case 44 + HeaderDNT: // case 44 if ((_bits & 0x100000000000L) != 0) { - _current = new KeyValuePair(HeaderNames.TraceParent, _collection._headers._TraceParent); + _current = new KeyValuePair(HeaderNames.DNT, _collection._headers._DNT); + _currentKnownType = KnownHeaderType.DNT; _next = 45; return true; } - HeaderTraceState: // case 45 + HeaderUpgradeInsecureRequests: // case 45 if ((_bits & 0x200000000000L) != 0) { - _current = new KeyValuePair(HeaderNames.TraceState, _collection._headers._TraceState); + _current = new KeyValuePair(HeaderNames.UpgradeInsecureRequests, _collection._headers._UpgradeInsecureRequests); + _currentKnownType = KnownHeaderType.UpgradeInsecureRequests; _next = 46; return true; } - HeaderOrigin: // case 46 + HeaderRequestId: // case 46 if ((_bits & 0x400000000000L) != 0) { - _current = new KeyValuePair(HeaderNames.Origin, _collection._headers._Origin); + _current = new KeyValuePair(HeaderNames.RequestId, _collection._headers._RequestId); + _currentKnownType = KnownHeaderType.RequestId; _next = 47; return true; } - HeaderAccessControlRequestMethod: // case 47 + HeaderCorrelationContext: // case 47 if ((_bits & 0x800000000000L) != 0) { - _current = new KeyValuePair(HeaderNames.AccessControlRequestMethod, _collection._headers._AccessControlRequestMethod); + _current = new KeyValuePair(HeaderNames.CorrelationContext, _collection._headers._CorrelationContext); + _currentKnownType = KnownHeaderType.CorrelationContext; _next = 48; return true; } - HeaderAccessControlRequestHeaders: // case 48 + HeaderTraceParent: // case 48 if ((_bits & 0x1000000000000L) != 0) { - _current = new KeyValuePair(HeaderNames.AccessControlRequestHeaders, _collection._headers._AccessControlRequestHeaders); + _current = new KeyValuePair(HeaderNames.TraceParent, _collection._headers._TraceParent); + _currentKnownType = KnownHeaderType.TraceParent; _next = 49; return true; } - HeaderContentLength: // case 49 + HeaderTraceState: // case 49 + if ((_bits & 0x2000000000000L) != 0) + { + _current = new KeyValuePair(HeaderNames.TraceState, _collection._headers._TraceState); + _currentKnownType = KnownHeaderType.TraceState; + _next = 50; + return true; + } + HeaderOrigin: // case 50 + if ((_bits & 0x4000000000000L) != 0) + { + _current = new KeyValuePair(HeaderNames.Origin, _collection._headers._Origin); + _currentKnownType = KnownHeaderType.Origin; + _next = 51; + return true; + } + HeaderAccessControlRequestMethod: // case 51 + if ((_bits & 0x8000000000000L) != 0) + { + _current = new KeyValuePair(HeaderNames.AccessControlRequestMethod, _collection._headers._AccessControlRequestMethod); + _currentKnownType = KnownHeaderType.AccessControlRequestMethod; + _next = 52; + return true; + } + HeaderAccessControlRequestHeaders: // case 52 + if ((_bits & 0x10000000000000L) != 0) + { + _current = new KeyValuePair(HeaderNames.AccessControlRequestHeaders, _collection._headers._AccessControlRequestHeaders); + _currentKnownType = KnownHeaderType.AccessControlRequestHeaders; + _next = 53; + return true; + } + HeaderContentLength: // case 53 if (_collection._contentLength.HasValue) { _current = new KeyValuePair(HeaderNames.ContentLength, HeaderUtilities.FormatNonNegativeInt64(_collection._contentLength.Value)); - _next = 50; + _currentKnownType = KnownHeaderType.ContentLength; + _next = 54; return true; } ExtraHeaders: if (!_hasUnknown || !_unknownEnumerator.MoveNext()) { _current = default(KeyValuePair); + _currentKnownType = default; return false; } _current = _unknownEnumerator.Current; + _currentKnownType = KnownHeaderType.Unknown; return true; } } @@ -11679,6 +12292,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x1L) != 0) { _current = new KeyValuePair(HeaderNames.CacheControl, _collection._headers._CacheControl); + _currentKnownType = KnownHeaderType.CacheControl; _next = 1; return true; } @@ -11686,6 +12300,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x2L) != 0) { _current = new KeyValuePair(HeaderNames.Connection, _collection._headers._Connection); + _currentKnownType = KnownHeaderType.Connection; _next = 2; return true; } @@ -11693,6 +12308,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x4L) != 0) { _current = new KeyValuePair(HeaderNames.Date, _collection._headers._Date); + _currentKnownType = KnownHeaderType.Date; _next = 3; return true; } @@ -11700,6 +12316,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x8L) != 0) { _current = new KeyValuePair(HeaderNames.KeepAlive, _collection._headers._KeepAlive); + _currentKnownType = KnownHeaderType.KeepAlive; _next = 4; return true; } @@ -11707,6 +12324,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x10L) != 0) { _current = new KeyValuePair(HeaderNames.Pragma, _collection._headers._Pragma); + _currentKnownType = KnownHeaderType.Pragma; _next = 5; return true; } @@ -11714,6 +12332,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x20L) != 0) { _current = new KeyValuePair(HeaderNames.Trailer, _collection._headers._Trailer); + _currentKnownType = KnownHeaderType.Trailer; _next = 6; return true; } @@ -11721,6 +12340,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x40L) != 0) { _current = new KeyValuePair(HeaderNames.TransferEncoding, _collection._headers._TransferEncoding); + _currentKnownType = KnownHeaderType.TransferEncoding; _next = 7; return true; } @@ -11728,6 +12348,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x80L) != 0) { _current = new KeyValuePair(HeaderNames.Upgrade, _collection._headers._Upgrade); + _currentKnownType = KnownHeaderType.Upgrade; _next = 8; return true; } @@ -11735,6 +12356,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x100L) != 0) { _current = new KeyValuePair(HeaderNames.Via, _collection._headers._Via); + _currentKnownType = KnownHeaderType.Via; _next = 9; return true; } @@ -11742,6 +12364,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x200L) != 0) { _current = new KeyValuePair(HeaderNames.Warning, _collection._headers._Warning); + _currentKnownType = KnownHeaderType.Warning; _next = 10; return true; } @@ -11749,6 +12372,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x400L) != 0) { _current = new KeyValuePair(HeaderNames.Allow, _collection._headers._Allow); + _currentKnownType = KnownHeaderType.Allow; _next = 11; return true; } @@ -11756,6 +12380,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x800L) != 0) { _current = new KeyValuePair(HeaderNames.ContentType, _collection._headers._ContentType); + _currentKnownType = KnownHeaderType.ContentType; _next = 12; return true; } @@ -11763,6 +12388,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x1000L) != 0) { _current = new KeyValuePair(HeaderNames.ContentEncoding, _collection._headers._ContentEncoding); + _currentKnownType = KnownHeaderType.ContentEncoding; _next = 13; return true; } @@ -11770,6 +12396,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x2000L) != 0) { _current = new KeyValuePair(HeaderNames.ContentLanguage, _collection._headers._ContentLanguage); + _currentKnownType = KnownHeaderType.ContentLanguage; _next = 14; return true; } @@ -11777,6 +12404,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x4000L) != 0) { _current = new KeyValuePair(HeaderNames.ContentLocation, _collection._headers._ContentLocation); + _currentKnownType = KnownHeaderType.ContentLocation; _next = 15; return true; } @@ -11784,6 +12412,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x8000L) != 0) { _current = new KeyValuePair(HeaderNames.ContentMD5, _collection._headers._ContentMD5); + _currentKnownType = KnownHeaderType.ContentMD5; _next = 16; return true; } @@ -11791,6 +12420,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x10000L) != 0) { _current = new KeyValuePair(HeaderNames.ContentRange, _collection._headers._ContentRange); + _currentKnownType = KnownHeaderType.ContentRange; _next = 17; return true; } @@ -11798,6 +12428,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x20000L) != 0) { _current = new KeyValuePair(HeaderNames.Expires, _collection._headers._Expires); + _currentKnownType = KnownHeaderType.Expires; _next = 18; return true; } @@ -11805,6 +12436,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x40000L) != 0) { _current = new KeyValuePair(HeaderNames.LastModified, _collection._headers._LastModified); + _currentKnownType = KnownHeaderType.LastModified; _next = 19; return true; } @@ -11812,6 +12444,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x80000L) != 0) { _current = new KeyValuePair(HeaderNames.AcceptRanges, _collection._headers._AcceptRanges); + _currentKnownType = KnownHeaderType.AcceptRanges; _next = 20; return true; } @@ -11819,6 +12452,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x100000L) != 0) { _current = new KeyValuePair(HeaderNames.Age, _collection._headers._Age); + _currentKnownType = KnownHeaderType.Age; _next = 21; return true; } @@ -11826,6 +12460,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x200000L) != 0) { _current = new KeyValuePair(HeaderNames.AltSvc, _collection._headers._AltSvc); + _currentKnownType = KnownHeaderType.AltSvc; _next = 22; return true; } @@ -11833,6 +12468,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x400000L) != 0) { _current = new KeyValuePair(HeaderNames.ETag, _collection._headers._ETag); + _currentKnownType = KnownHeaderType.ETag; _next = 23; return true; } @@ -11840,6 +12476,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x800000L) != 0) { _current = new KeyValuePair(HeaderNames.Location, _collection._headers._Location); + _currentKnownType = KnownHeaderType.Location; _next = 24; return true; } @@ -11847,6 +12484,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x1000000L) != 0) { _current = new KeyValuePair(HeaderNames.ProxyAuthenticate, _collection._headers._ProxyAuthenticate); + _currentKnownType = KnownHeaderType.ProxyAuthenticate; _next = 25; return true; } @@ -11854,6 +12492,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x2000000L) != 0) { _current = new KeyValuePair(HeaderNames.RetryAfter, _collection._headers._RetryAfter); + _currentKnownType = KnownHeaderType.RetryAfter; _next = 26; return true; } @@ -11861,6 +12500,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x4000000L) != 0) { _current = new KeyValuePair(HeaderNames.Server, _collection._headers._Server); + _currentKnownType = KnownHeaderType.Server; _next = 27; return true; } @@ -11868,6 +12508,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x8000000L) != 0) { _current = new KeyValuePair(HeaderNames.SetCookie, _collection._headers._SetCookie); + _currentKnownType = KnownHeaderType.SetCookie; _next = 28; return true; } @@ -11875,6 +12516,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x10000000L) != 0) { _current = new KeyValuePair(HeaderNames.Vary, _collection._headers._Vary); + _currentKnownType = KnownHeaderType.Vary; _next = 29; return true; } @@ -11882,6 +12524,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x20000000L) != 0) { _current = new KeyValuePair(HeaderNames.WWWAuthenticate, _collection._headers._WWWAuthenticate); + _currentKnownType = KnownHeaderType.WWWAuthenticate; _next = 30; return true; } @@ -11889,6 +12532,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x40000000L) != 0) { _current = new KeyValuePair(HeaderNames.AccessControlAllowCredentials, _collection._headers._AccessControlAllowCredentials); + _currentKnownType = KnownHeaderType.AccessControlAllowCredentials; _next = 31; return true; } @@ -11896,6 +12540,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x80000000L) != 0) { _current = new KeyValuePair(HeaderNames.AccessControlAllowHeaders, _collection._headers._AccessControlAllowHeaders); + _currentKnownType = KnownHeaderType.AccessControlAllowHeaders; _next = 32; return true; } @@ -11903,6 +12548,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x100000000L) != 0) { _current = new KeyValuePair(HeaderNames.AccessControlAllowMethods, _collection._headers._AccessControlAllowMethods); + _currentKnownType = KnownHeaderType.AccessControlAllowMethods; _next = 33; return true; } @@ -11910,6 +12556,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x200000000L) != 0) { _current = new KeyValuePair(HeaderNames.AccessControlAllowOrigin, _collection._headers._AccessControlAllowOrigin); + _currentKnownType = KnownHeaderType.AccessControlAllowOrigin; _next = 34; return true; } @@ -11917,6 +12564,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x400000000L) != 0) { _current = new KeyValuePair(HeaderNames.AccessControlExposeHeaders, _collection._headers._AccessControlExposeHeaders); + _currentKnownType = KnownHeaderType.AccessControlExposeHeaders; _next = 35; return true; } @@ -11924,6 +12572,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x800000000L) != 0) { _current = new KeyValuePair(HeaderNames.AccessControlMaxAge, _collection._headers._AccessControlMaxAge); + _currentKnownType = KnownHeaderType.AccessControlMaxAge; _next = 36; return true; } @@ -11931,6 +12580,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (_collection._contentLength.HasValue) { _current = new KeyValuePair(HeaderNames.ContentLength, HeaderUtilities.FormatNonNegativeInt64(_collection._contentLength.Value)); + _currentKnownType = KnownHeaderType.ContentLength; _next = 37; return true; } @@ -11938,9 +12588,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (!_hasUnknown || !_unknownEnumerator.MoveNext()) { _current = default(KeyValuePair); + _currentKnownType = default; return false; } _current = _unknownEnumerator.Current; + _currentKnownType = KnownHeaderType.Unknown; return true; } } @@ -12186,6 +12838,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x1L) != 0) { _current = new KeyValuePair(HeaderNames.ETag, _collection._headers._ETag); + _currentKnownType = KnownHeaderType.ETag; _next = 1; return true; } @@ -12194,9 +12847,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (!_hasUnknown || !_unknownEnumerator.MoveNext()) { _current = default(KeyValuePair); + _currentKnownType = default; return false; } _current = _unknownEnumerator.Current; + _currentKnownType = KnownHeaderType.Unknown; return true; } } diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/HttpRequestHeaders.cs b/src/Servers/Kestrel/Core/src/Internal/Http/HttpRequestHeaders.cs index f22588078c..a5e78a4442 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http/HttpRequestHeaders.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http/HttpRequestHeaders.cs @@ -127,6 +127,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http private readonly long _bits; private int _next; private KeyValuePair _current; + private KnownHeaderType _currentKnownType; private readonly bool _hasUnknown; private Dictionary.Enumerator _unknownEnumerator; @@ -136,6 +137,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http _bits = collection._bits; _next = 0; _current = default; + _currentKnownType = default; _hasUnknown = collection.MaybeUnknown != null; _unknownEnumerator = _hasUnknown ? collection.MaybeUnknown.GetEnumerator() @@ -144,6 +146,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http public KeyValuePair Current => _current; + internal KnownHeaderType CurrentKnownType => _currentKnownType; + object IEnumerator.Current => _current; public void Dispose() diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseHeaders.cs b/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseHeaders.cs index f2100b0cd8..e2ae921259 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseHeaders.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseHeaders.cs @@ -94,6 +94,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http private readonly long _bits; private int _next; private KeyValuePair _current; + private KnownHeaderType _currentKnownType; private readonly bool _hasUnknown; private Dictionary.Enumerator _unknownEnumerator; @@ -103,6 +104,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http _bits = collection._bits; _next = 0; _current = default; + _currentKnownType = default; _hasUnknown = collection.MaybeUnknown != null; _unknownEnumerator = _hasUnknown ? collection.MaybeUnknown.GetEnumerator() @@ -111,6 +113,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http public KeyValuePair Current => _current; + internal KnownHeaderType CurrentKnownType => _currentKnownType; + object IEnumerator.Current => _current; public void Dispose() diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseTrailers.cs b/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseTrailers.cs index ec4144cc83..6bae47c690 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseTrailers.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseTrailers.cs @@ -43,6 +43,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http private readonly long _bits; private int _next; private KeyValuePair _current; + private KnownHeaderType _currentKnownType; private readonly bool _hasUnknown; private Dictionary.Enumerator _unknownEnumerator; @@ -52,6 +53,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http _bits = collection._bits; _next = 0; _current = default; + _currentKnownType = default; _hasUnknown = collection.MaybeUnknown != null; _unknownEnumerator = _hasUnknown ? collection.MaybeUnknown.GetEnumerator() @@ -60,6 +62,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http public KeyValuePair Current => _current; + internal KnownHeaderType CurrentKnownType => _currentKnownType; + object IEnumerator.Current => _current; public void Dispose() diff --git a/src/Servers/Kestrel/Core/src/Internal/Http2/HPackHeaderWriter.cs b/src/Servers/Kestrel/Core/src/Internal/Http2/HPackHeaderWriter.cs new file mode 100644 index 0000000000..1598a18c7f --- /dev/null +++ b/src/Servers/Kestrel/Core/src/Internal/Http2/HPackHeaderWriter.cs @@ -0,0 +1,157 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Net.Http; +using System.Net.Http.HPack; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; + +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 +{ + internal static class HPackHeaderWriter + { + /// + /// Begin encoding headers in the first HEADERS frame. + /// + public static bool BeginEncodeHeaders(int statusCode, Http2HeadersEnumerator headersEnumerator, Span buffer, out int length) + { + if (!HPackEncoder.EncodeStatusHeader(statusCode, buffer, out var statusCodeLength)) + { + throw new HPackEncodingException(SR.net_http_hpack_encode_failure); + } + + if (!headersEnumerator.MoveNext()) + { + length = statusCodeLength; + return true; + } + + // We're ok with not throwing if no headers were encoded because we've already encoded the status. + // There is a small chance that the header will encode if there is no other content in the next HEADERS frame. + var done = EncodeHeaders(headersEnumerator, buffer.Slice(statusCodeLength), throwIfNoneEncoded: false, out var headersLength); + length = statusCodeLength + headersLength; + + return done; + } + + /// + /// Begin encoding headers in the first HEADERS frame. + /// + public static bool BeginEncodeHeaders(Http2HeadersEnumerator headersEnumerator, Span buffer, out int length) + { + if (!headersEnumerator.MoveNext()) + { + length = 0; + return true; + } + + return EncodeHeaders(headersEnumerator, buffer, throwIfNoneEncoded: true, out length); + } + + /// + /// Continue encoding headers in the next HEADERS frame. The enumerator should already have a current value. + /// + public static bool ContinueEncodeHeaders(Http2HeadersEnumerator headersEnumerator, Span buffer, out int length) + { + return EncodeHeaders(headersEnumerator, buffer, throwIfNoneEncoded: true, out length); + } + + private static bool EncodeHeaders(Http2HeadersEnumerator headersEnumerator, Span buffer, bool throwIfNoneEncoded, out int length) + { + var currentLength = 0; + do + { + if (!EncodeHeader(headersEnumerator.KnownHeaderType, headersEnumerator.Current.Key, headersEnumerator.Current.Value, buffer.Slice(currentLength), out int headerLength)) + { + // The the header wasn't written and no headers have been written then the header is too large. + // Throw an error to avoid an infinite loop of attempting to write large header. + if (currentLength == 0 && throwIfNoneEncoded) + { + throw new HPackEncodingException(SR.net_http_hpack_encode_failure); + } + + length = currentLength; + return false; + } + + currentLength += headerLength; + } + while (headersEnumerator.MoveNext()); + + length = currentLength; + + return true; + } + + private static bool EncodeHeader(KnownHeaderType knownHeaderType, string name, string value, Span buffer, out int length) + { + var hPackStaticTableId = GetResponseHeaderStaticTableId(knownHeaderType); + + if (hPackStaticTableId == -1) + { + return HPackEncoder.EncodeLiteralHeaderFieldWithoutIndexingNewName(name, value, buffer, out length); + } + else + { + return HPackEncoder.EncodeLiteralHeaderFieldWithoutIndexing(hPackStaticTableId, value, buffer, out length); + } + } + + private static int GetResponseHeaderStaticTableId(KnownHeaderType responseHeaderType) + { + switch (responseHeaderType) + { + case KnownHeaderType.CacheControl: + return H2StaticTable.CacheControl; + case KnownHeaderType.Date: + return H2StaticTable.Date; + case KnownHeaderType.TransferEncoding: + return H2StaticTable.TransferEncoding; + case KnownHeaderType.Via: + return H2StaticTable.Via; + case KnownHeaderType.Allow: + return H2StaticTable.Allow; + case KnownHeaderType.ContentType: + return H2StaticTable.ContentType; + case KnownHeaderType.ContentEncoding: + return H2StaticTable.ContentEncoding; + case KnownHeaderType.ContentLanguage: + return H2StaticTable.ContentLanguage; + case KnownHeaderType.ContentLocation: + return H2StaticTable.ContentLocation; + case KnownHeaderType.ContentRange: + return H2StaticTable.ContentRange; + case KnownHeaderType.Expires: + return H2StaticTable.Expires; + case KnownHeaderType.LastModified: + return H2StaticTable.LastModified; + case KnownHeaderType.AcceptRanges: + return H2StaticTable.AcceptRanges; + case KnownHeaderType.Age: + return H2StaticTable.Age; + case KnownHeaderType.ETag: + return H2StaticTable.ETag; + case KnownHeaderType.Location: + return H2StaticTable.Location; + case KnownHeaderType.ProxyAuthenticate: + return H2StaticTable.ProxyAuthenticate; + case KnownHeaderType.RetryAfter: + return H2StaticTable.RetryAfter; + case KnownHeaderType.Server: + return H2StaticTable.Server; + case KnownHeaderType.SetCookie: + return H2StaticTable.SetCookie; + case KnownHeaderType.Vary: + return H2StaticTable.Vary; + case KnownHeaderType.WWWAuthenticate: + return H2StaticTable.WwwAuthenticate; + case KnownHeaderType.AccessControlAllowOrigin: + return H2StaticTable.AccessControlAllowOrigin; + case KnownHeaderType.ContentLength: + return H2StaticTable.ContentLength; + default: + return -1; + } + } + } +} diff --git a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs index 848aca40c7..c3dbfb5d02 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs @@ -65,7 +65,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 private int _gracefulCloseInitiator; private int _isClosed; - private Http2StreamStack _streamPool; + // Internal for testing + internal Http2StreamStack StreamPool; internal const int InitialStreamPoolSize = 5; internal const int MaxStreamPoolSize = 40; @@ -111,7 +112,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 _serverSettings.InitialWindowSize = (uint)http2Limits.InitialStreamWindowSize; // Start pool off at a smaller size if the max number of streams is less than the InitialStreamPoolSize - _streamPool = new Http2StreamStack(Math.Min(InitialStreamPoolSize, http2Limits.MaxStreamsPerConnection)); + StreamPool = new Http2StreamStack(Math.Min(InitialStreamPoolSize, http2Limits.MaxStreamsPerConnection)); _inputTask = ReadInputAsync(); } @@ -572,7 +573,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 private Http2Stream GetStream(IHttpApplication application) { - if (_streamPool.TryPop(out var stream)) + if (StreamPool.TryPop(out var stream)) { stream.InitializeWithExistingContext(_incomingFrame.StreamId); return stream; @@ -606,9 +607,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 private void ReturnStream(Http2Stream stream) { - if (_streamPool.Count < MaxStreamPoolSize) + if (StreamPool.Count < MaxStreamPoolSize) { - _streamPool.Push(stream); + StreamPool.Push(stream); } } @@ -972,8 +973,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 catch (Http2StreamErrorException) { MakeSpaceInDrainQueue(); - // Tracked for draining - _completedStreams.Enqueue(_currentHeadersStream); + + // Because this stream isn't being queued, OnRequestProcessingEnded will not be + // automatically called and the stream won't be completed. + // Manually complete stream to ensure pipes are completed. + // Completing the stream will add it to the completed stream queue. + _currentHeadersStream.DecrementActiveClientStreamCount(); + _currentHeadersStream.CompleteStream(errored: true); throw; } diff --git a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2FrameWriter.cs b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2FrameWriter.cs index 415dbf3ba2..2d50e71d5f 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2FrameWriter.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2FrameWriter.cs @@ -7,6 +7,7 @@ using System.Buffers.Binary; using System.Collections.Generic; using System.Diagnostics; using System.IO.Pipelines; +using System.Net.Http; using System.Net.Http.HPack; using System.Threading; using System.Threading.Tasks; @@ -27,7 +28,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 private readonly object _writeLock = new object(); private readonly Http2Frame _outgoingFrame; - private readonly HPackEncoder _hpackEncoder = new HPackEncoder(); + private readonly Http2HeadersEnumerator _headersEnumerator = new Http2HeadersEnumerator(); private readonly ConcurrentPipeWriter _outputWriter; private readonly ConnectionContext _connectionContext; private readonly Http2Connection _http2Connection; @@ -160,7 +161,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 | Padding (*) ... +---------------------------------------------------------------+ */ - public void WriteResponseHeaders(int streamId, int statusCode, Http2HeadersFrameFlags headerFrameFlags, IHeaderDictionary headers) + public void WriteResponseHeaders(int streamId, int statusCode, Http2HeadersFrameFlags headerFrameFlags, HttpResponseHeaders headers) { lock (_writeLock) { @@ -171,9 +172,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 try { + _headersEnumerator.Initialize(headers); _outgoingFrame.PrepareHeaders(headerFrameFlags, streamId); var buffer = _headerEncodingBuffer.AsSpan(); - var done = _hpackEncoder.BeginEncode(statusCode, EnumerateHeaders(headers), buffer, out var payloadLength); + var done = HPackHeaderWriter.BeginEncodeHeaders(statusCode, _headersEnumerator, buffer, out var payloadLength); FinishWritingHeaders(streamId, payloadLength, done); } catch (HPackEncodingException hex) @@ -196,9 +198,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 try { + _headersEnumerator.Initialize(headers); _outgoingFrame.PrepareHeaders(Http2HeadersFrameFlags.END_STREAM, streamId); var buffer = _headerEncodingBuffer.AsSpan(); - var done = _hpackEncoder.BeginEncode(EnumerateHeaders(headers), buffer, out var payloadLength); + var done = HPackHeaderWriter.BeginEncodeHeaders(_headersEnumerator, buffer, out var payloadLength); FinishWritingHeaders(streamId, payloadLength, done); } catch (HPackEncodingException hex) @@ -227,7 +230,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 { _outgoingFrame.PrepareContinuation(Http2ContinuationFrameFlags.NONE, streamId); - done = _hpackEncoder.Encode(buffer, out payloadLength); + done = HPackHeaderWriter.ContinueEncodeHeaders(_headersEnumerator, buffer, out payloadLength); _outgoingFrame.PayloadLength = payloadLength; if (done) @@ -662,16 +665,5 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 flowControl.Abort(); } } - - private static IEnumerable> EnumerateHeaders(IHeaderDictionary headers) - { - foreach (var header in headers) - { - foreach (var value in header.Value) - { - yield return new KeyValuePair(header.Key, value); - } - } - } } } diff --git a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2HeaderEnumerator.cs b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2HeaderEnumerator.cs new file mode 100644 index 0000000000..421650b9fd --- /dev/null +++ b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2HeaderEnumerator.cs @@ -0,0 +1,169 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Collections; +using System.Collections.Generic; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; +using Microsoft.Extensions.Primitives; + +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 +{ + internal sealed class Http2HeadersEnumerator : IEnumerator> + { + private bool _isTrailers; + private HttpResponseHeaders.Enumerator _headersEnumerator; + private HttpResponseTrailers.Enumerator _trailersEnumerator; + private IEnumerator> _genericEnumerator; + private StringValues.Enumerator _stringValuesEnumerator; + + public KnownHeaderType KnownHeaderType { get; private set; } + public KeyValuePair Current { get; private set; } + object IEnumerator.Current => Current; + + public Http2HeadersEnumerator() + { + } + + public void Initialize(HttpResponseHeaders headers) + { + _headersEnumerator = headers.GetEnumerator(); + _trailersEnumerator = default; + _genericEnumerator = null; + _isTrailers = false; + + _stringValuesEnumerator = default; + Current = default; + KnownHeaderType = default; + } + + public void Initialize(HttpResponseTrailers headers) + { + _headersEnumerator = default; + _trailersEnumerator = headers.GetEnumerator(); + _genericEnumerator = null; + _isTrailers = true; + + _stringValuesEnumerator = default; + Current = default; + KnownHeaderType = default; + } + + public void Initialize(IDictionary headers) + { + _headersEnumerator = default; + _trailersEnumerator = default; + _genericEnumerator = headers.GetEnumerator(); + _isTrailers = false; + + _stringValuesEnumerator = default; + Current = default; + KnownHeaderType = default; + } + + public bool MoveNext() + { + if (MoveNextOnStringEnumerator()) + { + return true; + } + + if (!TryGetNextStringEnumerator(out _stringValuesEnumerator)) + { + return false; + } + + return MoveNextOnStringEnumerator(); + } + + private string GetCurrentKey() + { + if (_genericEnumerator != null) + { + return _genericEnumerator.Current.Key; + } + else if (_isTrailers) + { + return _trailersEnumerator.Current.Key; + } + else + { + return _headersEnumerator.Current.Key; + } + } + + private bool MoveNextOnStringEnumerator() + { + var result = _stringValuesEnumerator.MoveNext(); + Current = result ? new KeyValuePair(GetCurrentKey(), _stringValuesEnumerator.Current) : default; + return result; + } + + private bool TryGetNextStringEnumerator(out StringValues.Enumerator enumerator) + { + if (_genericEnumerator != null) + { + if (!_genericEnumerator.MoveNext()) + { + enumerator = default; + return false; + } + else + { + enumerator = _genericEnumerator.Current.Value.GetEnumerator(); + KnownHeaderType = default; + return true; + } + } + else if (_isTrailers) + { + if (!_trailersEnumerator.MoveNext()) + { + enumerator = default; + return false; + } + else + { + enumerator = _trailersEnumerator.Current.Value.GetEnumerator(); + KnownHeaderType = _trailersEnumerator.CurrentKnownType; + return true; + } + } + else + { + if (!_headersEnumerator.MoveNext()) + { + enumerator = default; + return false; + } + else + { + enumerator = _headersEnumerator.Current.Value.GetEnumerator(); + KnownHeaderType = _headersEnumerator.CurrentKnownType; + return true; + } + } + } + + public void Reset() + { + if (_genericEnumerator != null) + { + _genericEnumerator.Reset(); + } + else if (_isTrailers) + { + _trailersEnumerator.Reset(); + } + else + { + _headersEnumerator.Reset(); + } + _stringValuesEnumerator = default; + KnownHeaderType = default; + } + + public void Dispose() + { + } + } +} diff --git a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs index 7a6b75de8b..b3dccb8a23 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs @@ -71,6 +71,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 public void InitializeWithExistingContext(int streamId) { _context.StreamId = streamId; + Initialize(_context); } @@ -103,6 +104,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 } protected override void OnRequestProcessingEnded() + { + CompleteStream(errored: false); + } + + public void CompleteStream(bool errored) { try { @@ -110,14 +116,23 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 // If the app finished without reading the request body tell the client not to finish sending it. if (!EndStreamReceived && !RstStreamReceived) { - Log.RequestBodyNotEntirelyRead(ConnectionIdFeature, TraceIdentifier); + if (!errored) + { + Log.RequestBodyNotEntirelyRead(ConnectionIdFeature, TraceIdentifier); + } var (oldState, newState) = ApplyCompletionFlag(StreamCompletionFlags.Aborted); if (oldState != newState) { Debug.Assert(_decrementCalled); - // Don't block on IO. This never faults. - _ = _http2Output.WriteRstStreamAsync(Http2ErrorCode.NO_ERROR); + + // If there was an error starting the stream then we don't want to write RST_STREAM here. + // The connection will handle writing RST_STREAM with the correct error code. + if (!errored) + { + // Don't block on IO. This never faults. + _ = _http2Output.WriteRstStreamAsync(Http2ErrorCode.NO_ERROR); + } RequestBodyPipe.Writer.Complete(); } } @@ -129,8 +144,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 // The app can no longer read any more of the request body, so return any bytes that weren't read to the // connection's flow-control window. _inputFlowControl.Abort(); - - Reset(); } finally { @@ -173,7 +186,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 // CONNECT - :scheme and :path must be excluded if (Method == HttpMethod.Connect) { - if (!String.IsNullOrEmpty(RequestHeaders[HeaderNames.Scheme]) || !String.IsNullOrEmpty(RequestHeaders[HeaderNames.Path])) + if (!String.IsNullOrEmpty(HttpRequestHeaders.HeaderScheme) || !String.IsNullOrEmpty(HttpRequestHeaders.HeaderPath)) { ResetAndAbort(new ConnectionAbortedException(CoreStrings.Http2ErrorConnectMustNotSendSchemeOrPath), Http2ErrorCode.PROTOCOL_ERROR); return false; @@ -192,16 +205,16 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 // - That said, we shouldn't allow arbitrary values or use them to populate Request.Scheme, right? // - For now we'll restrict it to http/s and require it match the transport. // - We'll need to find some concrete scenarios to warrant unblocking this. - if (!string.Equals(RequestHeaders[HeaderNames.Scheme], Scheme, StringComparison.OrdinalIgnoreCase)) + if (!string.Equals(HttpRequestHeaders.HeaderScheme, Scheme, StringComparison.OrdinalIgnoreCase)) { ResetAndAbort(new ConnectionAbortedException( - CoreStrings.FormatHttp2StreamErrorSchemeMismatch(RequestHeaders[HeaderNames.Scheme], Scheme)), Http2ErrorCode.PROTOCOL_ERROR); + CoreStrings.FormatHttp2StreamErrorSchemeMismatch(HttpRequestHeaders.HeaderScheme, Scheme)), Http2ErrorCode.PROTOCOL_ERROR); return false; } // :path (and query) - Required // Must start with / except may be * for OPTIONS - var path = RequestHeaders[HeaderNames.Path].ToString(); + var path = HttpRequestHeaders.HeaderPath.ToString(); RawTarget = path; // OPTIONS - https://tools.ietf.org/html/rfc7540#section-8.1.2.3 @@ -238,7 +251,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 private bool TryValidateMethod() { // :method - _methodText = RequestHeaders[HeaderNames.Method].ToString(); + _methodText = HttpRequestHeaders.HeaderMethod.ToString(); Method = HttpUtilities.GetKnownMethod(_methodText); if (Method == HttpMethod.None) @@ -264,7 +277,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 // :authority (optional) // Prefer this over Host - var authority = RequestHeaders[HeaderNames.Authority]; + var authority = HttpRequestHeaders.HeaderAuthority; var host = HttpRequestHeaders.HeaderHost; if (!StringValues.IsNullOrEmpty(authority)) { diff --git a/src/Servers/Kestrel/Core/test/HPackEncoderTests.cs b/src/Servers/Kestrel/Core/test/HPackHeaderWriterTests.cs similarity index 83% rename from src/Servers/Kestrel/Core/test/HPackEncoderTests.cs rename to src/Servers/Kestrel/Core/test/HPackHeaderWriterTests.cs index b41eb2a910..3b290d712b 100644 --- a/src/Servers/Kestrel/Core/test/HPackEncoderTests.cs +++ b/src/Servers/Kestrel/Core/test/HPackHeaderWriterTests.cs @@ -3,12 +3,14 @@ using System; using System.Collections.Generic; -using System.Net.Http.HPack; +using System.Linq; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2; +using Microsoft.Extensions.Primitives; using Xunit; namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests { - public class HPackEncoderTests + public class HPackHeaderWriterTests { public static TheoryData[], byte[], int?> SinglePayloadData { @@ -89,16 +91,15 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests [MemberData(nameof(SinglePayloadData))] public void EncodesHeadersInSinglePayloadWhenSpaceAvailable(KeyValuePair[] headers, byte[] expectedPayload, int? statusCode) { - var encoder = new HPackEncoder(); var payload = new byte[1024]; var length = 0; if (statusCode.HasValue) { - Assert.True(encoder.BeginEncode(statusCode.Value, headers, payload, out length)); + Assert.True(HPackHeaderWriter.BeginEncodeHeaders(statusCode.Value, GetHeadersEnumerator(headers), payload, out length)); } else { - Assert.True(encoder.BeginEncode(headers, payload, out length)); + Assert.True(HPackHeaderWriter.BeginEncodeHeaders(GetHeadersEnumerator(headers), payload, out length)); } Assert.Equal(expectedPayload.Length, length); @@ -115,10 +116,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests [InlineData(false)] public void EncodesHeadersInMultiplePayloadsWhenSpaceNotAvailable(bool exactSize) { - var encoder = new HPackEncoder(); - var statusCode = 200; - var headers = new [] + var headers = new[] { new KeyValuePair("date", "Mon, 24 Jul 2017 19:22:30 GMT"), new KeyValuePair("content-type", "text/html; charset=utf-8"), @@ -156,33 +155,45 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests Span payload = new byte[1024]; var offset = 0; + var headerEnumerator = GetHeadersEnumerator(headers); // When !exactSize, slices are one byte short of fitting the next header var sliceLength = expectedStatusCodePayload.Length + (exactSize ? 0 : expectedDateHeaderPayload.Length - 1); - Assert.False(encoder.BeginEncode(statusCode, headers, payload.Slice(offset, sliceLength), out var length)); + Assert.False(HPackHeaderWriter.BeginEncodeHeaders(statusCode, headerEnumerator, payload.Slice(offset, sliceLength), out var length)); Assert.Equal(expectedStatusCodePayload.Length, length); Assert.Equal(expectedStatusCodePayload, payload.Slice(0, length).ToArray()); offset += length; sliceLength = expectedDateHeaderPayload.Length + (exactSize ? 0 : expectedContentTypeHeaderPayload.Length - 1); - Assert.False(encoder.Encode(payload.Slice(offset, sliceLength), out length)); + Assert.False(HPackHeaderWriter.ContinueEncodeHeaders(headerEnumerator, payload.Slice(offset, sliceLength), out length)); Assert.Equal(expectedDateHeaderPayload.Length, length); Assert.Equal(expectedDateHeaderPayload, payload.Slice(offset, length).ToArray()); offset += length; sliceLength = expectedContentTypeHeaderPayload.Length + (exactSize ? 0 : expectedServerHeaderPayload.Length - 1); - Assert.False(encoder.Encode(payload.Slice(offset, sliceLength), out length)); + Assert.False(HPackHeaderWriter.ContinueEncodeHeaders(headerEnumerator, payload.Slice(offset, sliceLength), out length)); Assert.Equal(expectedContentTypeHeaderPayload.Length, length); Assert.Equal(expectedContentTypeHeaderPayload, payload.Slice(offset, length).ToArray()); offset += length; sliceLength = expectedServerHeaderPayload.Length; - Assert.True(encoder.Encode(payload.Slice(offset, sliceLength), out length)); + Assert.True(HPackHeaderWriter.ContinueEncodeHeaders(headerEnumerator, payload.Slice(offset, sliceLength), out length)); Assert.Equal(expectedServerHeaderPayload.Length, length); Assert.Equal(expectedServerHeaderPayload, payload.Slice(offset, length).ToArray()); } + + private static Http2HeadersEnumerator GetHeadersEnumerator(IEnumerable> headers) + { + var groupedHeaders = headers + .GroupBy(k => k.Key) + .ToDictionary(g => g.Key, g => new StringValues(g.Select(gg => gg.Value).ToArray())); + + var enumerator = new Http2HeadersEnumerator(); + enumerator.Initialize(groupedHeaders); + return enumerator; + } } } diff --git a/src/Servers/Kestrel/Kestrel/test/GeneratedCodeTests.cs b/src/Servers/Kestrel/Kestrel/test/GeneratedCodeTests.cs index f2b8985906..da53ab050b 100644 --- a/src/Servers/Kestrel/Kestrel/test/GeneratedCodeTests.cs +++ b/src/Servers/Kestrel/Kestrel/test/GeneratedCodeTests.cs @@ -13,15 +13,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests public class GeneratedCodeTests { [ConditionalFact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2223", FlakyOn.Helix.All)] public void GeneratedCodeIsUpToDate() { var httpHeadersGeneratedPath = Path.Combine(AppContext.BaseDirectory, "shared", "GeneratedContent", "HttpHeaders.Generated.cs"); var httpProtocolGeneratedPath = Path.Combine(AppContext.BaseDirectory, "shared", "GeneratedContent", "HttpProtocol.Generated.cs"); var httpUtilitiesGeneratedPath = Path.Combine(AppContext.BaseDirectory, "shared", "GeneratedContent", "HttpUtilities.Generated.cs"); var http2ConnectionGeneratedPath = Path.Combine(AppContext.BaseDirectory, "shared", "GeneratedContent", "Http2Connection.Generated.cs"); - var transportMultiplexedConnectionGeneratedPath = Path.Combine(AppContext.BaseDirectory,"shared", "GeneratedContent", "TransportMultiplexedConnection.Generated.cs"); - var transportConnectionGeneratedPath = Path.Combine(AppContext.BaseDirectory,"shared", "GeneratedContent", "TransportConnection.Generated.cs"); + var transportMultiplexedConnectionGeneratedPath = Path.Combine(AppContext.BaseDirectory, "shared", "GeneratedContent", "TransportMultiplexedConnection.Generated.cs"); + var transportConnectionGeneratedPath = Path.Combine(AppContext.BaseDirectory, "shared", "GeneratedContent", "TransportConnection.Generated.cs"); var testHttpHeadersGeneratedPath = Path.GetTempFileName(); var testHttpProtocolGeneratedPath = Path.GetTempFileName(); diff --git a/src/Servers/Kestrel/Transport.Quic/src/Internal/QuicConnectionListener.cs b/src/Servers/Kestrel/Transport.Quic/src/Internal/QuicConnectionListener.cs index 1b36d90ab0..12af5859f6 100644 --- a/src/Servers/Kestrel/Transport.Quic/src/Internal/QuicConnectionListener.cs +++ b/src/Servers/Kestrel/Transport.Quic/src/Internal/QuicConnectionListener.cs @@ -29,10 +29,18 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Internal _log = log; _context = new QuicTransportContext(_log, options); EndPoint = endpoint; + + var quicListenerOptions = new QuicListenerOptions(); var sslConfig = new SslServerAuthenticationOptions(); sslConfig.ServerCertificate = options.Certificate; sslConfig.ApplicationProtocols = new List() { new SslApplicationProtocol(options.Alpn) }; - _listener = new QuicListener(QuicImplementationProviders.MsQuic, endpoint as IPEndPoint, sslConfig); + + quicListenerOptions.ServerAuthenticationOptions = sslConfig; + quicListenerOptions.CertificateFilePath = options.CertificateFilePath; + quicListenerOptions.PrivateKeyFilePath = options.PrivateKeyFilePath; + quicListenerOptions.ListenEndPoint = endpoint as IPEndPoint; + + _listener = new QuicListener(QuicImplementationProviders.MsQuic, quicListenerOptions); _listener.Start(); } diff --git a/src/Servers/Kestrel/Transport.Quic/src/QuicTransportOptions.cs b/src/Servers/Kestrel/Transport.Quic/src/QuicTransportOptions.cs index 985222d3d1..8ed5fe3dd8 100644 --- a/src/Servers/Kestrel/Transport.Quic/src/QuicTransportOptions.cs +++ b/src/Servers/Kestrel/Transport.Quic/src/QuicTransportOptions.cs @@ -29,6 +29,16 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Quic /// public X509Certificate2 Certificate { get; set; } + /// + /// Optional path to certificate file to configure the security configuration. + /// + public string CertificateFilePath { get; set; } + + /// + /// Optional path to private key file to configure the security configuration. + /// + public string PrivateKeyFilePath { get; set; } + /// /// Sets the idle timeout for connections and streams. /// diff --git a/src/Servers/Kestrel/perf/Kestrel.Performance/Http2ConnectionBenchmark.cs b/src/Servers/Kestrel/perf/Kestrel.Performance/Http2ConnectionBenchmark.cs new file mode 100644 index 0000000000..3018f4a346 --- /dev/null +++ b/src/Servers/Kestrel/perf/Kestrel.Performance/Http2ConnectionBenchmark.cs @@ -0,0 +1,100 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Buffers; +using System.Collections.Generic; +using System.IO.Pipelines; +using System.Net.Http.HPack; +using System.Threading.Tasks; +using BenchmarkDotNet.Attributes; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.Features; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; +using Microsoft.AspNetCore.Testing; +using Microsoft.Extensions.Logging.Abstractions; +using Microsoft.Extensions.Primitives; +using Microsoft.Net.Http.Headers; + +namespace Microsoft.AspNetCore.Server.Kestrel.Performance +{ + public class Http2ConnectionBenchmark + { + private MemoryPool _memoryPool; + private Pipe _pipe; + private HttpRequestHeaders _httpRequestHeaders; + private Http2Connection _connection; + private Http2HeadersEnumerator _requestHeadersEnumerator; + private int _currentStreamId; + private byte[] _headersBuffer; + + [GlobalSetup] + public void GlobalSetup() + { + _memoryPool = SlabMemoryPoolFactory.Create(); + + var options = new PipeOptions(_memoryPool, readerScheduler: PipeScheduler.Inline, writerScheduler: PipeScheduler.Inline, useSynchronizationContext: false); + _pipe = new Pipe(options); + + _httpRequestHeaders = new HttpRequestHeaders(); + _httpRequestHeaders.Append(HeaderNames.Method, new StringValues("GET")); + _httpRequestHeaders.Append(HeaderNames.Path, new StringValues("/")); + _httpRequestHeaders.Append(HeaderNames.Scheme, new StringValues("http")); + _httpRequestHeaders.Append(HeaderNames.Authority, new StringValues("localhost:80")); + + _headersBuffer = new byte[1024 * 16]; + + var serviceContext = new ServiceContext + { + DateHeaderValueManager = new DateHeaderValueManager(), + ServerOptions = new KestrelServerOptions(), + Log = new KestrelTrace(NullLogger.Instance), + SystemClock = new MockSystemClock() + }; + serviceContext.ServerOptions.Limits.Http2.MaxStreamsPerConnection = int.MaxValue; + serviceContext.DateHeaderValueManager.OnHeartbeat(default); + + _connection = new Http2Connection(new HttpConnectionContext + { + MemoryPool = _memoryPool, + ConnectionId = "TestConnectionId", + Protocols = Core.HttpProtocols.Http2, + Transport = new MockDuplexPipe(_pipe.Reader, new NullPipeWriter()), + ServiceContext = serviceContext, + ConnectionFeatures = new FeatureCollection(), + TimeoutControl = new MockTimeoutControl(), + }); + + _requestHeadersEnumerator = new Http2HeadersEnumerator(); + + _currentStreamId = 1; + + _ = _connection.ProcessRequestsAsync(new DummyApplication()); + + _pipe.Writer.Write(Http2Connection.ClientPreface); + _pipe.Writer.WriteSettings(new Http2PeerSettings()); + _pipe.Writer.FlushAsync().GetAwaiter().GetResult(); + } + + [Benchmark] + public async Task EmptyRequest() + { + _requestHeadersEnumerator.Initialize(_httpRequestHeaders); + _requestHeadersEnumerator.MoveNext(); + _pipe.Writer.WriteStartStream(streamId: _currentStreamId, _requestHeadersEnumerator, _headersBuffer, endStream: true); + _currentStreamId += 2; + await _pipe.Writer.FlushAsync(); + } + + [GlobalCleanup] + public void Dispose() + { + _pipe.Writer.Complete(); + _memoryPool?.Dispose(); + } + } +} diff --git a/src/Servers/Kestrel/perf/Kestrel.Performance/Http2FrameWriterBenchmark.cs b/src/Servers/Kestrel/perf/Kestrel.Performance/Http2FrameWriterBenchmark.cs new file mode 100644 index 0000000000..fcf5476e93 --- /dev/null +++ b/src/Servers/Kestrel/perf/Kestrel.Performance/Http2FrameWriterBenchmark.cs @@ -0,0 +1,59 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Buffers; +using System.IO.Pipelines; +using BenchmarkDotNet.Attributes; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.FlowControl; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; +using Microsoft.Extensions.Logging.Abstractions; + +namespace Microsoft.AspNetCore.Server.Kestrel.Performance +{ + public class Http2FrameWriterBenchmark + { + private MemoryPool _memoryPool; + private Pipe _pipe; + private Http2FrameWriter _frameWriter; + private HttpResponseHeaders _responseHeaders; + + [GlobalSetup] + public void GlobalSetup() + { + _memoryPool = SlabMemoryPoolFactory.Create(); + + var options = new PipeOptions(_memoryPool, readerScheduler: PipeScheduler.Inline, writerScheduler: PipeScheduler.Inline, useSynchronizationContext: false); + _pipe = new Pipe(options); + + _frameWriter = new Http2FrameWriter( + new NullPipeWriter(), + connectionContext: null, + http2Connection: null, + new OutputFlowControl(initialWindowSize: uint.MaxValue), + timeoutControl: null, + minResponseDataRate: null, + "TestConnectionId", + _memoryPool, + new KestrelTrace(NullLogger.Instance)); + + _responseHeaders = new HttpResponseHeaders(); + _responseHeaders.HeaderContentType = "application/json"; + _responseHeaders.HeaderContentLength = "1024"; + } + + [Benchmark] + public void WriteResponseHeaders() + { + _frameWriter.WriteResponseHeaders(0, 200, Http2HeadersFrameFlags.END_HEADERS, _responseHeaders); + } + + [GlobalCleanup] + public void Dispose() + { + _pipe.Writer.Complete(); + _memoryPool?.Dispose(); + } + } +} diff --git a/src/Servers/Kestrel/perf/Kestrel.Performance/Microsoft.AspNetCore.Server.Kestrel.Performance.csproj b/src/Servers/Kestrel/perf/Kestrel.Performance/Microsoft.AspNetCore.Server.Kestrel.Performance.csproj index 07c9d49f68..ef22ae3002 100644 --- a/src/Servers/Kestrel/perf/Kestrel.Performance/Microsoft.AspNetCore.Server.Kestrel.Performance.csproj +++ b/src/Servers/Kestrel/perf/Kestrel.Performance/Microsoft.AspNetCore.Server.Kestrel.Performance.csproj @@ -1,4 +1,4 @@ - + $(DefaultNetCoreTargetFramework) @@ -10,6 +10,8 @@ + + diff --git a/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/MockDuplexPipe.cs b/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/MockDuplexPipe.cs new file mode 100644 index 0000000000..86f6dc3112 --- /dev/null +++ b/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/MockDuplexPipe.cs @@ -0,0 +1,19 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.IO.Pipelines; + +namespace Microsoft.AspNetCore.Server.Kestrel.Performance +{ + internal class MockDuplexPipe : IDuplexPipe + { + public MockDuplexPipe(PipeReader input, PipeWriter output) + { + Input = input; + Output = output; + } + + public PipeReader Input { get; } + public PipeWriter Output { get; } + } +} diff --git a/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/MockSystemClock.cs b/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/MockSystemClock.cs new file mode 100644 index 0000000000..960d2cba95 --- /dev/null +++ b/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/MockSystemClock.cs @@ -0,0 +1,15 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; + +namespace Microsoft.AspNetCore.Server.Kestrel.Performance +{ + internal class MockSystemClock : ISystemClock + { + public DateTimeOffset UtcNow { get; } + public long UtcNowTicks { get; } + public DateTimeOffset UtcNowUnsynchronized { get; } + } +} diff --git a/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/MockTimeoutControl.cs b/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/MockTimeoutControl.cs new file mode 100644 index 0000000000..54865db3c3 --- /dev/null +++ b/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/MockTimeoutControl.cs @@ -0,0 +1,62 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.FlowControl; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; + +namespace Microsoft.AspNetCore.Server.Kestrel.Performance +{ + internal class MockTimeoutControl : ITimeoutControl + { + public TimeoutReason TimerReason { get; } = TimeoutReason.KeepAlive; + + public void BytesRead(long count) + { + } + + public void BytesWrittenToBuffer(MinDataRate minRate, long count) + { + } + + public void CancelTimeout() + { + } + + public void InitializeHttp2(InputFlowControl connectionInputFlowControl) + { + } + + public void ResetTimeout(long ticks, TimeoutReason timeoutReason) + { + } + + public void SetTimeout(long ticks, TimeoutReason timeoutReason) + { + } + + public void StartRequestBody(MinDataRate minRate) + { + } + + public void StartTimingRead() + { + } + + public void StartTimingWrite() + { + } + + public void StopRequestBody() + { + } + + public void StopTimingRead() + { + } + + public void StopTimingWrite() + { + } + } +} diff --git a/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/NullPipeWriter.cs b/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/NullPipeWriter.cs new file mode 100644 index 0000000000..c982ec4902 --- /dev/null +++ b/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/NullPipeWriter.cs @@ -0,0 +1,43 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.IO.Pipelines; +using System.Threading; +using System.Threading.Tasks; + +namespace Microsoft.AspNetCore.Server.Kestrel.Performance +{ + internal class NullPipeWriter : PipeWriter + { + // Should be large enough for any content attempting to write to the buffer + private readonly byte[] _buffer = new byte[1024 * 128]; + + public override void Advance(int bytes) + { + } + + public override void CancelPendingFlush() + { + } + + public override void Complete(Exception exception = null) + { + } + + public override ValueTask FlushAsync(CancellationToken cancellationToken = default) + { + return new ValueTask(new FlushResult(false, true)); + } + + public override Memory GetMemory(int sizeHint = 0) + { + return _buffer; + } + + public override Span GetSpan(int sizeHint = 0) + { + return _buffer; + } + } +} diff --git a/src/Servers/Kestrel/samples/http2cat/http2cat.csproj b/src/Servers/Kestrel/samples/http2cat/http2cat.csproj index b9c20f8799..5bfcc5fda7 100644 --- a/src/Servers/Kestrel/samples/http2cat/http2cat.csproj +++ b/src/Servers/Kestrel/samples/http2cat/http2cat.csproj @@ -38,4 +38,4 @@ - \ No newline at end of file + diff --git a/src/Servers/Kestrel/shared/KnownHeaders.cs b/src/Servers/Kestrel/shared/KnownHeaders.cs index fd57db25ae..e6389a675e 100644 --- a/src/Servers/Kestrel/shared/KnownHeaders.cs +++ b/src/Servers/Kestrel/shared/KnownHeaders.cs @@ -19,6 +19,10 @@ namespace CodeGenerator { var requestPrimaryHeaders = new[] { + ":authority", + ":method", + ":path", + ":scheme", "Accept", "Connection", "Host", @@ -72,6 +76,10 @@ namespace CodeGenerator }; RequestHeaders = commonHeaders.Concat(new[] { + ":authority", + ":method", + ":path", + ":scheme", "Accept", "Accept-Charset", "Accept-Encoding", @@ -247,7 +255,7 @@ namespace CodeGenerator { public string Name { get; set; } public int Index { get; set; } - public string Identifier => Name.Replace("-", ""); + public string Identifier => ResolveIdentifier(Name); public byte[] Bytes => Encoding.ASCII.GetBytes($"\r\n{Name}: "); public int BytesOffset { get; set; } @@ -264,6 +272,21 @@ namespace CodeGenerator public string SetBit() => $"_bits |= {"0x" + (1L << Index).ToString("x")}L"; public string ClearBit() => $"_bits &= ~{"0x" + (1L << Index).ToString("x")}L"; + private string ResolveIdentifier(string name) + { + var identifer = name.Replace("-", ""); + + // Pseudo headers start with a colon. A colon isn't valid in C# names so + // remove it and pascal case the header name. e.g. :path -> Path, :scheme -> Scheme. + // This identifier will match the names in HeadersNames.cs + if (identifer.StartsWith(':')) + { + identifer = char.ToUpper(identifer[1]) + identifer.Substring(2); + } + + return identifer; + } + private void GetMaskAndComp(string name, int offset, int count, out ulong mask, out ulong comp) { mask = 0; @@ -539,6 +562,9 @@ namespace CodeGenerator var responseTrailers = ResponseTrailers; + var allHeaderNames = RequestHeaders.Concat(ResponseHeaders).Concat(ResponseTrailers) + .Select(h => h.Identifier).Distinct().OrderBy(n => n).ToArray(); + var loops = new[] { new @@ -589,6 +615,11 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http {{ + internal enum KnownHeaderType + {{ + Unknown,{Each(allHeaderNames, n => @" + " + n + ",")} + }} {Each(loops, loop => $@" internal partial class {loop.ClassName} {{{(loop.Bytes != null ? @@ -1035,6 +1066,7 @@ $@" private void Clear(long bitsToClear) if ({header.TestBit()}) {{ _current = new KeyValuePair(HeaderNames.{header.Identifier}, _collection._headers._{header.Identifier}); + _currentKnownType = KnownHeaderType.{header.Identifier}; _next = {header.Index + 1}; return true; }}")} @@ -1042,6 +1074,7 @@ $@" private void Clear(long bitsToClear) if (_collection._contentLength.HasValue) {{ _current = new KeyValuePair(HeaderNames.ContentLength, HeaderUtilities.FormatNonNegativeInt64(_collection._contentLength.Value)); + _currentKnownType = KnownHeaderType.ContentLength; _next = {loop.Headers.Count()}; return true; }}" : "")} @@ -1049,9 +1082,11 @@ $@" private void Clear(long bitsToClear) if (!_hasUnknown || !_unknownEnumerator.MoveNext()) {{ _current = default(KeyValuePair); + _currentKnownType = default; return false; }} _current = _unknownEnumerator.Current; + _currentKnownType = KnownHeaderType.Unknown; return true; }} }} diff --git a/src/Servers/Kestrel/shared/test/PipeWriterHttp2FrameExtensions.cs b/src/Servers/Kestrel/shared/test/PipeWriterHttp2FrameExtensions.cs new file mode 100644 index 0000000000..daf333e703 --- /dev/null +++ b/src/Servers/Kestrel/shared/test/PipeWriterHttp2FrameExtensions.cs @@ -0,0 +1,94 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Buffers; +using System.Collections.Generic; +using System.IO.Pipelines; +using System.Net.Http.HPack; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2; + +namespace Microsoft.AspNetCore.Testing +{ + internal static class PipeWriterHttp2FrameExtensions + { + public static void WriteSettings(this PipeWriter writer, Http2PeerSettings clientSettings) + { + var frame = new Http2Frame(); + frame.PrepareSettings(Http2SettingsFrameFlags.NONE); + var settings = clientSettings.GetNonProtocolDefaults(); + var payload = new byte[settings.Count * Http2FrameReader.SettingSize]; + frame.PayloadLength = payload.Length; + Http2FrameWriter.WriteSettings(settings, payload); + Http2FrameWriter.WriteHeader(frame, writer); + writer.Write(payload); + } + + public static void WriteStartStream(this PipeWriter writer, int streamId, Http2HeadersEnumerator headers, byte[] headerEncodingBuffer, bool endStream) + { + var frame = new Http2Frame(); + frame.PrepareHeaders(Http2HeadersFrameFlags.NONE, streamId); + + var buffer = headerEncodingBuffer.AsSpan(); + var done = HPackHeaderWriter.BeginEncodeHeaders(headers, buffer, out var length); + frame.PayloadLength = length; + + if (done) + { + frame.HeadersFlags = Http2HeadersFrameFlags.END_HEADERS; + } + + if (endStream) + { + frame.HeadersFlags |= Http2HeadersFrameFlags.END_STREAM; + } + + Http2FrameWriter.WriteHeader(frame, writer); + writer.Write(buffer.Slice(0, length)); + + while (!done) + { + frame.PrepareContinuation(Http2ContinuationFrameFlags.NONE, streamId); + + done = HPackHeaderWriter.ContinueEncodeHeaders(headers, buffer, out length); + frame.PayloadLength = length; + + if (done) + { + frame.ContinuationFlags = Http2ContinuationFrameFlags.END_HEADERS; + } + + Http2FrameWriter.WriteHeader(frame, writer); + writer.Write(buffer.Slice(0, length)); + } + } + + public static void WriteStartStream(this PipeWriter writer, int streamId, Span headerData, bool endStream) + { + var frame = new Http2Frame(); + frame.PrepareHeaders(Http2HeadersFrameFlags.NONE, streamId); + frame.PayloadLength = headerData.Length; + frame.HeadersFlags = Http2HeadersFrameFlags.END_HEADERS; + + if (endStream) + { + frame.HeadersFlags |= Http2HeadersFrameFlags.END_STREAM; + } + + Http2FrameWriter.WriteHeader(frame, writer); + writer.Write(headerData); + } + + public static void WriteData(this PipeWriter writer, int streamId, Memory data, bool endStream) + { + var frame = new Http2Frame(); + + frame.PrepareData(streamId); + frame.PayloadLength = data.Length; + frame.DataFlags = endStream ? Http2DataFrameFlags.END_STREAM : Http2DataFrameFlags.NONE; + + Http2FrameWriter.WriteHeader(frame, writer); + writer.Write(data.Span); + } + } +} diff --git a/src/Servers/Kestrel/test/BindTests/AddressRegistrationTests.cs b/src/Servers/Kestrel/test/BindTests/AddressRegistrationTests.cs index 635936b6f5..787d3fe7c8 100644 --- a/src/Servers/Kestrel/test/BindTests/AddressRegistrationTests.cs +++ b/src/Servers/Kestrel/test/BindTests/AddressRegistrationTests.cs @@ -100,7 +100,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests [ConditionalTheory] [MemberData(nameof(IPEndPointRegistrationDataDynamicPort))] [IPv6SupportedCondition] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2074", FlakyOn.AzP.macOS)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2074")] public async Task RegisterIPEndPoint_DynamicPort_Success(IPEndPoint endPoint, string testUrl) { await RegisterIPEndPoint_Success(endPoint, testUrl); @@ -109,7 +109,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests [ConditionalTheory] [MemberData(nameof(IPEndPointRegistrationDataPort443))] [IPv6SupportedCondition] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2711", FlakyOn.AzP.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2711")] public async Task RegisterIPEndPoint_Port443_Success(IPEndPoint endpoint, string testUrl) { if (!CanBindToEndpoint(endpoint.Address, 443)) @@ -131,7 +131,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests [ConditionalTheory] [MemberData(nameof(AddressRegistrationDataIPv6Port5000Default))] [IPv6SupportedCondition] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2711", FlakyOn.AzP.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2711")] public async Task RegisterAddresses_IPv6Port5000Default_Success(string addressInput, string[] testUrls) { if (!CanBindToEndpoint(IPAddress.Loopback, 5000) || !CanBindToEndpoint(IPAddress.IPv6Loopback, 5000)) @@ -145,7 +145,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests [ConditionalTheory] [MemberData(nameof(AddressRegistrationDataIPv6Port80))] [IPv6SupportedCondition] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2711", FlakyOn.AzP.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2711")] public async Task RegisterAddresses_IPv6Port80_Success(string addressInput, string[] testUrls) { if (!CanBindToEndpoint(IPAddress.Loopback, 80) || !CanBindToEndpoint(IPAddress.IPv6Loopback, 80)) @@ -157,7 +157,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests } [ConditionalTheory] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2179", FlakyOn.Helix.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2179")] [MemberData(nameof(AddressRegistrationDataIPv6ScopeId))] [IPv6SupportedCondition] [IPv6ScopeIdPresentCondition] @@ -596,7 +596,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests } [Fact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2178", FlakyOn.All)] public async Task DoesNotOverrideDirectConfigurationWithIServerAddressesFeature_IfPreferHostingUrlsFalse() { var useUrlsAddress = $"http://127.0.0.1:0"; @@ -881,7 +880,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests var exception = Assert.Throws(() => host.Start()); var thisAddressString = $"http://{(addressFamily == AddressFamily.InterNetwork ? "127.0.0.1" : "[::1]")}:{port}"; - var otherAddressString = $"http://{(addressFamily == AddressFamily.InterNetworkV6? "127.0.0.1" : "[::1]")}:{port}"; + var otherAddressString = $"http://{(addressFamily == AddressFamily.InterNetworkV6 ? "127.0.0.1" : "[::1]")}:{port}"; if (exception.Message == CoreStrings.FormatEndpointAlreadyInUse(otherAddressString)) { diff --git a/src/Servers/Kestrel/test/FunctionalTests/ConnectionMiddlewareTests.cs b/src/Servers/Kestrel/test/FunctionalTests/ConnectionMiddlewareTests.cs index 29c4129c93..aa16d48a88 100644 --- a/src/Servers/Kestrel/test/FunctionalTests/ConnectionMiddlewareTests.cs +++ b/src/Servers/Kestrel/test/FunctionalTests/ConnectionMiddlewareTests.cs @@ -14,7 +14,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests { public class ConnectionMiddlewareTests : LoggedTest { - [Flaky("", FlakyOn.All)] [Fact] public async Task ThrowingSynchronousConnectionMiddlewareDoesNotCrashServer() { diff --git a/src/Servers/Kestrel/test/FunctionalTests/Http2/ShutdownTests.cs b/src/Servers/Kestrel/test/FunctionalTests/Http2/ShutdownTests.cs index 7bed5ea335..9ce2aa0563 100644 --- a/src/Servers/Kestrel/test/FunctionalTests/Http2/ShutdownTests.cs +++ b/src/Servers/Kestrel/test/FunctionalTests/Http2/ShutdownTests.cs @@ -45,7 +45,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests.Http2 [CollectDump] [ConditionalFact] [SkipOnHelix("https://github.com/dotnet/aspnetcore/issues/9985", Queues = "Fedora.28.Amd64;Fedora.28.Amd64.Open")] - [Flaky("https://github.com/dotnet/aspnetcore/issues/9985", FlakyOn.All)] public async Task GracefulShutdownWaitsForRequestsToFinish() { var requestStarted = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); @@ -101,7 +100,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests.Http2 } [ConditionalFact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2667", FlakyOn.All)] public async Task GracefulTurnsAbortiveIfRequestsDoNotFinish() { var requestStarted = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); diff --git a/src/Servers/Kestrel/test/FunctionalTests/MaxRequestBufferSizeTests.cs b/src/Servers/Kestrel/test/FunctionalTests/MaxRequestBufferSizeTests.cs index b3c17c8ea3..59c3b9ce4c 100644 --- a/src/Servers/Kestrel/test/FunctionalTests/MaxRequestBufferSizeTests.cs +++ b/src/Servers/Kestrel/test/FunctionalTests/MaxRequestBufferSizeTests.cs @@ -108,7 +108,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests } } [Theory] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2489", FlakyOn.AzP.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2489")] [MemberData(nameof(LargeUploadData))] public async Task LargeUpload(long? maxRequestBufferSize, bool connectionAdapter, bool expectPause) { diff --git a/src/Servers/Kestrel/test/FunctionalTests/RequestTests.cs b/src/Servers/Kestrel/test/FunctionalTests/RequestTests.cs index 29357eb718..1953b86c6b 100644 --- a/src/Servers/Kestrel/test/FunctionalTests/RequestTests.cs +++ b/src/Servers/Kestrel/test/FunctionalTests/RequestTests.cs @@ -132,9 +132,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests [ConditionalFact] [IPv6SupportedCondition] -#if LIBUV - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/1977", FlakyOn.Helix.All)] // https://github.com/dotnet/aspnetcore/issues/8109 -#endif public Task RemoteIPv6Address() { return TestRemoteIPAddress("[::1]", "[::1]", "::1"); @@ -538,7 +535,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests } [Theory] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2181", FlakyOn.Helix.All)] [MemberData(nameof(ConnectionMiddlewareData))] public async Task ConnectionClosedTokenFiresOnServerFIN(ListenOptions listenOptions) { @@ -791,9 +787,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests } [Theory] -#if LIBUV - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/1971", FlakyOn.Helix.All)] -#endif [MemberData(nameof(ConnectionMiddlewareData))] public async Task AppCanHandleClientAbortingConnectionMidRequest(ListenOptions listenOptions) { diff --git a/src/Servers/Kestrel/test/FunctionalTests/ResponseTests.cs b/src/Servers/Kestrel/test/FunctionalTests/ResponseTests.cs index 1928b618c8..85b4f8a51c 100644 --- a/src/Servers/Kestrel/test/FunctionalTests/ResponseTests.cs +++ b/src/Servers/Kestrel/test/FunctionalTests/ResponseTests.cs @@ -339,7 +339,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests } [Theory] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/1972", FlakyOn.All)] [MemberData(nameof(ConnectionMiddlewareData))] public async Task AppCanHandleClientAbortingConnectionMidResponse(ListenOptions listenOptions) { @@ -640,7 +639,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests } [Fact] - [Flaky("", FlakyOn.All)] public async Task ConnectionClosedWhenBothRequestAndResponseExperienceBackPressure() { const int bufferSize = 65536; @@ -735,7 +733,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests } [ConditionalFact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2181", FlakyOn.All)] public async Task ConnectionNotClosedWhenClientSatisfiesMinimumDataRateGivenLargeResponseChunks() { var chunkSize = 64 * 128 * 1024; @@ -815,7 +812,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests [Fact] [CollectDump] - [Flaky("", FlakyOn.All)] public async Task ConnectionNotClosedWhenClientSatisfiesMinimumDataRateGivenLargeResponseHeaders() { var headerSize = 1024 * 1024; // 1 MB for each header value @@ -903,7 +899,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests } [Fact] - [Flaky("https://github.com/dotnet/aspnetcore/issues/13219", FlakyOn.AzP.Linux, FlakyOn.Helix.All)] public async Task ClientCanReceiveFullConnectionCloseResponseWithoutErrorAtALowDataRate() { var chunkSize = 64 * 128 * 1024; diff --git a/src/Servers/Kestrel/test/FunctionalTests/UnixDomainSocketsTests.cs b/src/Servers/Kestrel/test/FunctionalTests/UnixDomainSocketsTests.cs index cca069aeae..dc247c6543 100644 --- a/src/Servers/Kestrel/test/FunctionalTests/UnixDomainSocketsTests.cs +++ b/src/Servers/Kestrel/test/FunctionalTests/UnixDomainSocketsTests.cs @@ -30,7 +30,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests #endif [ConditionalFact] [CollectDump] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task TestUnixDomainSocket() { var path = Path.GetTempFileName(); diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/ConnectionLimitTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/ConnectionLimitTests.cs index 43c92b0121..532629f0dd 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/ConnectionLimitTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/ConnectionLimitTests.cs @@ -142,7 +142,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests } [Fact] - [Flaky("https://github.com/aspnet/KestrelHttpServer/issues/2282", FlakyOn.AzP.macOS)] + [QuarantinedTest("https://github.com/aspnet/KestrelHttpServer/issues/2282")] public async Task ConnectionCountingReturnsToZero() { const int count = 100; diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs index 9814918386..310398d00e 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs @@ -14,6 +14,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Connections; using Microsoft.AspNetCore.Server.Kestrel.Core.Features; using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.Logging; using Microsoft.Net.Http.Headers; @@ -24,6 +25,256 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests { public class Http2ConnectionTests : Http2TestBase { + [Fact] + public async Task RequestHeaderStringReuse_MultipleStreams_KnownHeaderReused() + { + IEnumerable> requestHeaders = new[] + { + new KeyValuePair(HeaderNames.Method, "GET"), + new KeyValuePair(HeaderNames.Path, "/hello"), + new KeyValuePair(HeaderNames.Scheme, "http"), + new KeyValuePair(HeaderNames.Authority, "localhost:80"), + new KeyValuePair(HeaderNames.ContentType, "application/json") + }; + + await InitializeConnectionAsync(_readHeadersApplication); + + await StartStreamAsync(1, requestHeaders, endStream: true); + + await ExpectAsync(Http2FrameType.HEADERS, + withLength: 37, + withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), + withStreamId: 1); + + var contentType1 = _receivedHeaders["Content-Type"]; + + // Ping will trigger the stream to be returned to the pool so we can assert it + await SendPingAsync(Http2PingFrameFlags.NONE); + await ExpectAsync(Http2FrameType.PING, + withLength: 8, + withFlags: (byte)Http2PingFrameFlags.ACK, + withStreamId: 0); + + // Stream has been returned to the pool + Assert.Equal(1, _connection.StreamPool.Count); + + await StartStreamAsync(3, requestHeaders, endStream: true); + + await ExpectAsync(Http2FrameType.HEADERS, + withLength: 37, + withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), + withStreamId: 3); + + var contentType2 = _receivedHeaders["Content-Type"]; + + Assert.Same(contentType1, contentType2); + + await StopConnectionAsync(expectedLastStreamId: 3, ignoreNonGoAwayFrames: false); + } + + [Fact] + public async Task StreamPool_SingleStream_ReturnedToPool() + { + await InitializeConnectionAsync(_echoApplication); + + Assert.Equal(0, _connection.StreamPool.Count); + + await StartStreamAsync(1, _browserRequestHeaders, endStream: true); + + await ExpectAsync(Http2FrameType.HEADERS, + withLength: 37, + withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), + withStreamId: 1); + + // Ping will trigger the stream to be returned to the pool so we can assert it + await SendPingAsync(Http2PingFrameFlags.NONE); + await ExpectAsync(Http2FrameType.PING, + withLength: 8, + withFlags: (byte)Http2PingFrameFlags.ACK, + withStreamId: 0); + + // Stream has been returned to the pool + Assert.Equal(1, _connection.StreamPool.Count); + + await StopConnectionAsync(expectedLastStreamId: 1, ignoreNonGoAwayFrames: false); + } + + [Fact] + public async Task StreamPool_MultipleStreamsConcurrent_StreamsReturnedToPool() + { + await InitializeConnectionAsync(_echoApplication); + + Assert.Equal(0, _connection.StreamPool.Count); + + await StartStreamAsync(1, _browserRequestHeaders, endStream: false); + await StartStreamAsync(3, _browserRequestHeaders, endStream: false); + + await SendDataAsync(1, _helloBytes, endStream: true); + + await ExpectAsync(Http2FrameType.HEADERS, + withLength: 33, + withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, + withStreamId: 1); + await ExpectAsync(Http2FrameType.DATA, + withLength: 5, + withFlags: (byte)Http2DataFrameFlags.NONE, + withStreamId: 1); + await ExpectAsync(Http2FrameType.DATA, + withLength: 0, + withFlags: (byte)Http2DataFrameFlags.END_STREAM, + withStreamId: 1); + + await SendDataAsync(3, _helloBytes, endStream: true); + + await ExpectAsync(Http2FrameType.HEADERS, + withLength: 33, + withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, + withStreamId: 3); + await ExpectAsync(Http2FrameType.DATA, + withLength: 5, + withFlags: (byte)Http2DataFrameFlags.NONE, + withStreamId: 3); + await ExpectAsync(Http2FrameType.DATA, + withLength: 0, + withFlags: (byte)Http2DataFrameFlags.END_STREAM, + withStreamId: 3); + + // Ping will trigger the stream to be returned to the pool so we can assert it + await SendPingAsync(Http2PingFrameFlags.NONE); + await ExpectAsync(Http2FrameType.PING, + withLength: 8, + withFlags: (byte)Http2PingFrameFlags.ACK, + withStreamId: 0); + + // Streams have been returned to the pool + Assert.Equal(2, _connection.StreamPool.Count); + + await StopConnectionAsync(expectedLastStreamId: 3, ignoreNonGoAwayFrames: false); + } + + [Fact] + [QuarantinedTest] + public async Task StreamPool_MultipleStreamsInSequence_PooledStreamReused() + { + TaskCompletionSource appDelegateTcs = null; + + await InitializeConnectionAsync(async context => + { + await appDelegateTcs.Task; + }); + + Assert.Equal(0, _connection.StreamPool.Count); + + appDelegateTcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + await StartStreamAsync(1, _browserRequestHeaders, endStream: true); + + appDelegateTcs.TrySetResult(null); + + await ExpectAsync(Http2FrameType.HEADERS, + withLength: 37, + withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), + withStreamId: 1); + + // Ping will trigger the stream to be returned to the pool so we can assert it + await SendPingAsync(Http2PingFrameFlags.NONE); + await ExpectAsync(Http2FrameType.PING, + withLength: 8, + withFlags: (byte)Http2PingFrameFlags.ACK, + withStreamId: 0); + + // Stream has been returned to the pool + Assert.Equal(1, _connection.StreamPool.Count); + + appDelegateTcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + await StartStreamAsync(3, _browserRequestHeaders, endStream: true); + + // New stream has been taken from the pool + Assert.Equal(0, _connection.StreamPool.Count); + + appDelegateTcs.TrySetResult(null); + + await ExpectAsync(Http2FrameType.HEADERS, + withLength: 37, + withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), + withStreamId: 3); + + // Ping will trigger the stream to be returned to the pool so we can assert it + await SendPingAsync(Http2PingFrameFlags.NONE); + await ExpectAsync(Http2FrameType.PING, + withLength: 8, + withFlags: (byte)Http2PingFrameFlags.ACK, + withStreamId: 0); + + // Stream was reused and returned to the pool + Assert.Equal(1, _connection.StreamPool.Count); + + await StopConnectionAsync(expectedLastStreamId: 3, ignoreNonGoAwayFrames: false); + } + + [Fact] + public async Task StreamPool_EndedStreamErrorsOnStart_ReturnedToPool() + { + await InitializeConnectionAsync(_echoApplication); + + _connection.ServerSettings.MaxConcurrentStreams = 1; + + await StartStreamAsync(1, _browserRequestHeaders, endStream: false); + + // This stream will error because it exceeds max concurrent streams + await StartStreamAsync(3, _browserRequestHeaders, endStream: true); + await WaitForStreamErrorAsync(3, Http2ErrorCode.REFUSED_STREAM, CoreStrings.Http2ErrorMaxStreams); + + // Ping will trigger the stream to be returned to the pool so we can assert it + await SendPingAsync(Http2PingFrameFlags.NONE); + await ExpectAsync(Http2FrameType.PING, + withLength: 8, + withFlags: (byte)Http2PingFrameFlags.ACK, + withStreamId: 0); + + // Stream returned to the pool + Assert.Equal(1, _connection.StreamPool.Count); + + await StopConnectionAsync(expectedLastStreamId: 3, ignoreNonGoAwayFrames: false); + } + + [Fact] + public async Task StreamPool_UnendedStreamErrorsOnStart_ReturnedToPool() + { + _serviceContext.ServerOptions.Limits.MinRequestBodyDataRate = null; + + await InitializeConnectionAsync(_echoApplication); + + _connection.ServerSettings.MaxConcurrentStreams = 1; + + await StartStreamAsync(1, _browserRequestHeaders, endStream: false); + + // This stream will error because it exceeds max concurrent streams + await StartStreamAsync(3, _browserRequestHeaders, endStream: false); + await WaitForStreamErrorAsync(3, Http2ErrorCode.REFUSED_STREAM, CoreStrings.Http2ErrorMaxStreams); + + // Ping will trigger the stream to be returned to the pool so we can assert it + await SendPingAsync(Http2PingFrameFlags.NONE); + await ExpectAsync(Http2FrameType.PING, + withLength: 8, + withFlags: (byte)Http2PingFrameFlags.ACK, + withStreamId: 0); + + AdvanceClock(TimeSpan.FromTicks(Constants.RequestBodyDrainTimeout.Ticks + 1)); + + // Ping will trigger the stream to attempt to be returned to the pool + await SendPingAsync(Http2PingFrameFlags.NONE); + await ExpectAsync(Http2FrameType.PING, + withLength: 8, + withFlags: (byte)Http2PingFrameFlags.ACK, + withStreamId: 0); + + // Stream was returned to the pool because of the drain timeout + Assert.Equal(1, _connection.StreamPool.Count); + + await StopConnectionAsync(expectedLastStreamId: 3, ignoreNonGoAwayFrames: false); + + } + [Fact] public async Task Frame_Received_OverMaxSize_FrameError() { @@ -53,7 +304,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[length], endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); // The client's settings is still defaulted to Http2PeerSettings.MinAllowedMaxFrameSize so the echo response will come back in two separate frames @@ -82,7 +333,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloWorldBytes, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var dataFrame = await ExpectAsync(Http2FrameType.DATA, @@ -108,7 +359,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _maxData, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -151,7 +402,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests } await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -272,7 +523,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _noData, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var dataFrame = await ExpectAsync(Http2FrameType.DATA, @@ -300,7 +551,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloBytes, endStream: false); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var stream1DataFrame1 = await ExpectAsync(Http2FrameType.DATA, @@ -311,7 +562,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(3, _helloBytes, endStream: false); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 3); var stream3DataFrame1 = await ExpectAsync(Http2FrameType.DATA, @@ -380,7 +631,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests } await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -432,7 +683,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests withStreamId: 0); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 3); @@ -510,7 +761,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests stream3ReadFinished.TrySetResult(null); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 3); await ExpectAsync(Http2FrameType.DATA, @@ -525,7 +776,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests stream1ReadFinished.TrySetResult(null); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -552,7 +803,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataWithPaddingAsync(1, _helloWorldBytes, padLength, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var dataFrame = await ExpectAsync(Http2FrameType.DATA, @@ -597,7 +848,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests } await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -656,7 +907,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests } await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -725,7 +976,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _maxData, endStream: false); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -900,7 +1151,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _postRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -920,7 +1171,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests [Fact] public async Task Frame_MultipleStreams_CanBeCreatedIfClientCountIsLessThanActualMaxStreamCount() { - _serviceContext.ServerOptions.Limits.Http2.MaxStreamsPerConnection = 1; + _serviceContext.ServerOptions.Limits.Http2.MaxStreamsPerConnection = 1; var firstRequestBlock = new TaskCompletionSource(); var firstRequestReceived = new TaskCompletionSource(); var makeFirstRequestWait = false; @@ -942,7 +1193,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(3, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 3); @@ -992,7 +1243,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(3, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 3); @@ -1096,7 +1347,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -1117,7 +1368,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(3, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 3); @@ -1151,7 +1402,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1166,7 +1417,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1186,7 +1437,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendHeadersWithPaddingAsync(1, _browserRequestHeaders, padLength, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1203,7 +1454,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendHeadersWithPriorityAsync(1, _browserRequestHeaders, priority: 42, streamDependency: 0, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1223,7 +1474,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendHeadersWithPaddingAndPriorityAsync(1, _browserRequestHeaders, padLength, priority: 42, streamDependency: 0, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1249,7 +1500,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // The second stream should end first, since the first one is waiting for the request body. await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 3); @@ -1261,7 +1512,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendHeadersAsync(1, Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM, _requestTrailers); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1295,7 +1546,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloBytes, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -1345,14 +1596,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests finishSecondRequest.TrySetResult(null); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 3); finishFirstRequest.TrySetResult(null); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1378,7 +1629,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests requestBlocker.SetResult(0); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1421,7 +1672,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1464,7 +1715,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(3, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 3); @@ -1688,7 +1939,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendHeadersAsync(1, Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM, headers); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1833,7 +2084,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendHeadersAsync(1, Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM, headers); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1971,7 +2222,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -1996,7 +2247,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // The headers, but not the data for stream 3, can be sent prior to any window updates. await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 3); @@ -2080,7 +2331,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(streamId, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: streamId); @@ -2560,7 +2811,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests _connection.ServerSettings.MaxFrameSize = Http2PeerSettings.MaxAllowedMaxFrameSize; // This includes the default response headers such as :status, etc - var defaultResponseHeaderLength = 37; + var defaultResponseHeaderLength = 33; var headerValueLength = Http2PeerSettings.MinAllowedMaxFrameSize; // First byte is always 0 // Second byte is the length of header name which is 1 @@ -2630,7 +2881,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -2779,7 +3030,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloBytes, true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -2792,7 +3043,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests withStreamId: 1); await SendDataAsync(3, _helloBytes, true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 3); await ExpectAsync(Http2FrameType.DATA, @@ -2865,7 +3116,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -2888,13 +3139,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // The headers, but not the data for the stream, can still be sent. await StartStreamAsync(3, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 3); await StartStreamAsync(5, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 5); @@ -2958,7 +3209,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(streamId, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: streamId); @@ -3191,7 +3442,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -3248,7 +3499,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloWorldBytes, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -3287,7 +3538,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloWorldBytes, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -3339,7 +3590,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _twoContinuationsRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -3365,7 +3616,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // The second stream should end first, since the first one is waiting for the request body. await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 3); @@ -3388,7 +3639,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendContinuationAsync(1, Http2ContinuationFrameFlags.END_HEADERS, trailers); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -3410,8 +3661,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests { await InitializeConnectionAsync(_readHeadersApplication); - await SendHeadersAsync(1, Http2HeadersFrameFlags.NONE, _oneContinuationRequestHeaders); - await SendContinuationAsync(3, Http2ContinuationFrameFlags.END_HEADERS); + var headersEnumerator = GetHeadersEnumerator(_oneContinuationRequestHeaders); + await SendHeadersAsync(1, Http2HeadersFrameFlags.NONE, headersEnumerator); + await SendContinuationAsync(3, Http2ContinuationFrameFlags.END_HEADERS, headersEnumerator); await WaitForConnectionErrorAsync( ignoreNonGoAwayFrames: false, @@ -3485,7 +3737,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendEmptyContinuationFrameAsync(1, Http2ContinuationFrameFlags.END_HEADERS); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -3500,7 +3752,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 12361, + withLength: 12343, withFlags: (byte)Http2HeadersFrameFlags.END_STREAM, withStreamId: 1); var continuationFrame1 = await ExpectAsync(Http2FrameType.CONTINUATION, @@ -3659,7 +3911,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -3709,7 +3961,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloBytes, true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -3743,7 +3995,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloBytes, true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -3756,7 +4008,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests withStreamId: 1); await SendDataAsync(3, _helloBytes, true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 3); await ExpectAsync(Http2FrameType.DATA, @@ -3846,7 +4098,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: false); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2StreamTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2StreamTests.cs index 6d9e6da62e..a59207ccda 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2StreamTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2StreamTests.cs @@ -79,7 +79,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 70, + withLength: 52, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -104,7 +104,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendHeadersAsync(1, Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM, headers); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 71, + withLength: 53, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -131,7 +131,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendHeadersAsync(1, Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM, headers); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 75, + withLength: 57, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -159,7 +159,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendHeadersAsync(1, Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM, headers); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 76, + withLength: 58, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -193,7 +193,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendHeadersAsync(1, Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM, headers); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 118, + withLength: 100, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -235,7 +235,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendHeadersAsync(1, Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM, headers); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -297,7 +297,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -326,7 +326,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -355,7 +355,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 65, + withLength: 47, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -386,7 +386,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 65, + withLength: 47, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -417,7 +417,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 65, + withLength: 47, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -448,7 +448,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 65, + withLength: 47, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -570,7 +570,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[12], endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -611,7 +611,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[12], endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -655,7 +655,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[8], endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -698,7 +698,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[8], endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -751,7 +751,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[8], endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -983,7 +983,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[12], endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1015,7 +1015,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 56, + withLength: 38, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.RST_STREAM, @@ -1054,7 +1054,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 56, + withLength: 38, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -1092,7 +1092,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1125,7 +1125,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -1160,7 +1160,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -1198,7 +1198,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -1236,7 +1236,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -1276,7 +1276,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -1323,7 +1323,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -1361,7 +1361,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -1397,7 +1397,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -1441,7 +1441,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 56, + withLength: 38, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -1475,7 +1475,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -1508,7 +1508,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 56, + withLength: 38, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -1552,7 +1552,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[12], endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1591,7 +1591,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: false); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 59, + withLength: 41, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1634,7 +1634,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[12], endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1674,7 +1674,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[6], endStream: false); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 59, + withLength: 41, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1733,7 +1733,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[6], endStream: false); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 59, + withLength: 41, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1788,7 +1788,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[12], endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1814,7 +1814,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -1852,7 +1852,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_STREAM | Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); @@ -1883,7 +1883,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); var headersFrame1 = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var trailersFrame1 = await ExpectAsync(Http2FrameType.HEADERS, @@ -1894,7 +1894,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(3, _browserRequestHeaders, endStream: true); var headersFrame2 = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 3); @@ -1930,7 +1930,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -1980,7 +1980,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -2039,7 +2039,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -2074,7 +2074,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -2124,7 +2124,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true).DefaultTimeout(); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1).DefaultTimeout(); @@ -2189,7 +2189,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -2235,7 +2235,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -2269,7 +2269,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -2532,7 +2532,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -2623,7 +2623,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -2671,7 +2671,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // Just the StatusCode gets written before aborting in the continuation frame await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.NONE, withStreamId: 1); @@ -2700,7 +2700,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -2743,7 +2743,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -2789,7 +2789,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var dataFrame = await ExpectAsync(Http2FrameType.DATA, @@ -2835,7 +2835,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var dataFrame = await ExpectAsync(Http2FrameType.DATA, @@ -2884,7 +2884,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var dataFrame = await ExpectAsync(Http2FrameType.DATA, @@ -2937,7 +2937,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var dataFrame = await ExpectAsync(Http2FrameType.DATA, @@ -2987,7 +2987,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var dataFrame = await ExpectAsync(Http2FrameType.DATA, @@ -3037,7 +3037,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var dataFrame = await ExpectAsync(Http2FrameType.DATA, @@ -3080,7 +3080,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var dataFrame = await ExpectAsync(Http2FrameType.DATA, @@ -3126,7 +3126,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var dataFrame = await ExpectAsync(Http2FrameType.DATA, @@ -3168,7 +3168,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -3213,7 +3213,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -3279,7 +3279,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 56, + withLength: 38, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -3325,7 +3325,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 56, + withLength: 38, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -3361,7 +3361,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 56, + withLength: 38, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -3413,7 +3413,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 56, + withLength: 38, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -3465,7 +3465,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -3498,7 +3498,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // Don't receive content length because we called WriteAsync which caused an invalid response var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS | (byte)Http2HeadersFrameFlags.END_STREAM, withStreamId: 1); @@ -3531,7 +3531,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -3583,7 +3583,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -3639,7 +3639,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var trailersFrame = await ExpectAsync(Http2FrameType.HEADERS, @@ -3705,7 +3705,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -3761,7 +3761,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var bodyFrame = await ExpectAsync(Http2FrameType.DATA, @@ -3826,7 +3826,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -3885,7 +3885,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var bodyFrame = await ExpectAsync(Http2FrameType.DATA, @@ -3941,7 +3941,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -4003,7 +4003,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var bodyFrame = await ExpectAsync(Http2FrameType.DATA, @@ -4077,7 +4077,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var bodyFrame = await ExpectAsync(Http2FrameType.DATA, @@ -4153,7 +4153,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 56, + withLength: 38, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var bodyFrame = await ExpectAsync(Http2FrameType.DATA, @@ -4224,7 +4224,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 56, + withLength: 38, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var bodyFrame = await ExpectAsync(Http2FrameType.DATA, @@ -4296,7 +4296,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var bodyFrame = await ExpectAsync(Http2FrameType.DATA, @@ -4380,7 +4380,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: false); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var bodyFrame = await ExpectAsync(Http2FrameType.DATA, @@ -4461,7 +4461,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var bodyFrame = await ExpectAsync(Http2FrameType.DATA, @@ -4548,7 +4548,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: false); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var bodyFrame = await ExpectAsync(Http2FrameType.DATA, @@ -4583,30 +4583,32 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests Assert.Equal("Custom Value", _decodedHeaders["CustomName"]); } + // :method = GET + // :path = / + // :scheme = http + // X-Test = £ + private static readonly byte[] LatinHeaderData = new byte[] + { + 0, 7, 58, 109, 101, 116, 104, 111, 100, 3, 71, 69, 84, 0, 5, 58, 112, 97, 116, + 104, 1, 47, 0, 7, 58, 115, 99, 104, 101, 109, 101, 4, 104, 116, 116, 112, 0, + 6, 120, 45, 116, 101, 115, 116, 1, 163 + }; + [Fact] public async Task HEADERS_Received_Latin1_AcceptedWhenLatin1OptionIsConfigured() { _serviceContext.ServerOptions.Latin1RequestHeaders = true; - var headers = new[] - { - new KeyValuePair(HeaderNames.Method, "GET"), - new KeyValuePair(HeaderNames.Path, "/"), - new KeyValuePair(HeaderNames.Scheme, "http"), - // The HPackEncoder will encode £ as 0xA3 aka Latin1 encoding. - new KeyValuePair("X-Test", "£"), - }; - await InitializeConnectionAsync(context => { Assert.Equal("£", context.Request.Headers["X-Test"]); return Task.CompletedTask; }); - await StartStreamAsync(1, headers, endStream: true); + await StartStreamAsync(1, LatinHeaderData, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -4623,18 +4625,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests [Fact] public async Task HEADERS_Received_Latin1_RejectedWhenLatin1OptionIsNotConfigured() { - var headers = new[] - { - new KeyValuePair(HeaderNames.Method, "GET"), - new KeyValuePair(HeaderNames.Path, "/"), - new KeyValuePair(HeaderNames.Scheme, "http"), - // The HPackEncoder will encode £ as 0xA3 aka Latin1 encoding. - new KeyValuePair("X-Test", "£"), - }; - await InitializeConnectionAsync(_noopApplication); - await StartStreamAsync(1, headers, endStream: true); + await StartStreamAsync(1, LatinHeaderData, endStream: true); await WaitForConnectionErrorAsync( ignoreNonGoAwayFrames: true, diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TestBase.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TestBase.cs index 22bc15f2fc..9277372a79 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TestBase.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TestBase.cs @@ -26,6 +26,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.FlowControl; using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Primitives; using Microsoft.Net.Http.Headers; using Moq; using Xunit; @@ -118,7 +119,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests private readonly MemoryPool _memoryPool = SlabMemoryPoolFactory.Create(); internal readonly Http2PeerSettings _clientSettings = new Http2PeerSettings(); - internal readonly HPackEncoder _hpackEncoder = new HPackEncoder(); internal readonly HPackDecoder _hpackDecoder; private readonly byte[] _headerEncodingBuffer = new byte[Http2PeerSettings.MinAllowedMaxFrameSize]; @@ -500,42 +500,17 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); _runningStreams[streamId] = tcs; - var frame = new Http2Frame(); - frame.PrepareHeaders(Http2HeadersFrameFlags.NONE, streamId); + writableBuffer.WriteStartStream(streamId, GetHeadersEnumerator(headers), _headerEncodingBuffer, endStream); + return FlushAsync(writableBuffer); + } - var buffer = _headerEncodingBuffer.AsSpan(); - var done = _hpackEncoder.BeginEncode(headers, buffer, out var length); - frame.PayloadLength = length; - - if (done) - { - frame.HeadersFlags = Http2HeadersFrameFlags.END_HEADERS; - } - - if (endStream) - { - frame.HeadersFlags |= Http2HeadersFrameFlags.END_STREAM; - } - - Http2FrameWriter.WriteHeader(frame, writableBuffer); - writableBuffer.Write(buffer.Slice(0, length)); - - while (!done) - { - frame.PrepareContinuation(Http2ContinuationFrameFlags.NONE, streamId); - - done = _hpackEncoder.Encode(buffer, out length); - frame.PayloadLength = length; - - if (done) - { - frame.ContinuationFlags = Http2ContinuationFrameFlags.END_HEADERS; - } - - Http2FrameWriter.WriteHeader(frame, writableBuffer); - writableBuffer.Write(buffer.Slice(0, length)); - } + protected Task StartStreamAsync(int streamId, Span headerData, bool endStream) + { + var writableBuffer = _pair.Application.Output; + var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + _runningStreams[streamId] = tcs; + writableBuffer.WriteStartStream(streamId, headerData, endStream); return FlushAsync(writableBuffer); } @@ -565,7 +540,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests extendedHeader[0] = padLength; var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); - _hpackEncoder.BeginEncode(headers, payload, out var length); + HPackHeaderWriter.BeginEncodeHeaders(GetHeadersEnumerator(headers), payload, out var length); var padding = buffer.Slice(extendedHeaderLength + length, padLength); padding.Fill(0); @@ -608,7 +583,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests extendedHeader[4] = priority; var payload = buffer.Slice(extendedHeaderLength); - _hpackEncoder.BeginEncode(headers, payload, out var length); + HPackHeaderWriter.BeginEncodeHeaders(GetHeadersEnumerator(headers), payload, out var length); frame.PayloadLength = extendedHeaderLength + length; @@ -655,7 +630,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests extendedHeader[5] = priority; var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); - _hpackEncoder.BeginEncode(headers, payload, out var length); + HPackHeaderWriter.BeginEncodeHeaders(GetHeadersEnumerator(headers), payload, out var length); var padding = buffer.Slice(extendedHeaderLength + length, padLength); padding.Fill(0); @@ -692,15 +667,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests protected async Task SendSettingsAsync() { - var writableBuffer = _pair.Application.Output; - var frame = new Http2Frame(); - frame.PrepareSettings(Http2SettingsFrameFlags.NONE); - var settings = _clientSettings.GetNonProtocolDefaults(); - var payload = new byte[settings.Count * Http2FrameReader.SettingSize]; - frame.PayloadLength = payload.Length; - Http2FrameWriter.WriteSettings(settings, payload); - Http2FrameWriter.WriteHeader(frame, writableBuffer); - await SendAsync(payload); + _pair.Application.Output.WriteSettings(_clientSettings); + await FlushAsync(_pair.Application.Output); } protected async Task SendSettingsAckWithInvalidLengthAsync(int length) @@ -769,14 +737,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests return FlushAsync(writableBuffer); } - internal async Task SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, IEnumerable> headers) + internal async Task SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, Http2HeadersEnumerator headersEnumerator) { var outputWriter = _pair.Application.Output; var frame = new Http2Frame(); frame.PrepareHeaders(flags, streamId); var buffer = _headerEncodingBuffer.AsMemory(); - var done = _hpackEncoder.BeginEncode(headers, buffer.Span, out var length); + var done = HPackHeaderWriter.BeginEncodeHeaders(headersEnumerator, buffer.Span, out var length); frame.PayloadLength = length; Http2FrameWriter.WriteHeader(frame, outputWriter); @@ -785,6 +753,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests return done; } + internal Task SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, IEnumerable> headers) + { + return SendHeadersAsync(streamId, flags, GetHeadersEnumerator(headers)); + } + internal async Task SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, byte[] headerBlock) { var outputWriter = _pair.Application.Output; @@ -834,14 +807,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendAsync(payload); } - internal async Task SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags) + internal async Task SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, Http2HeadersEnumerator headersEnumerator) { var outputWriter = _pair.Application.Output; var frame = new Http2Frame(); frame.PrepareContinuation(flags, streamId); var buffer = _headerEncodingBuffer.AsMemory(); - var done = _hpackEncoder.Encode(buffer.Span, out var length); + var done = HPackHeaderWriter.ContinueEncodeHeaders(headersEnumerator, buffer.Span, out var length); frame.PayloadLength = length; Http2FrameWriter.WriteHeader(frame, outputWriter); @@ -869,7 +842,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests frame.PrepareContinuation(flags, streamId); var buffer = _headerEncodingBuffer.AsMemory(); - var done = _hpackEncoder.BeginEncode(headers, buffer.Span, out var length); + var done = HPackHeaderWriter.BeginEncodeHeaders(GetHeadersEnumerator(headers), buffer.Span, out var length); frame.PayloadLength = length; Http2FrameWriter.WriteHeader(frame, outputWriter); @@ -878,6 +851,17 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests return done; } + internal Http2HeadersEnumerator GetHeadersEnumerator(IEnumerable> headers) + { + var dictionary = headers + .GroupBy(g => g.Key) + .ToDictionary(g => g.Key, g => new StringValues(g.Select(values => values.Value).ToArray())); + + var headersEnumerator = new Http2HeadersEnumerator(); + headersEnumerator.Initialize(dictionary); + return headersEnumerator; + } + internal Task SendEmptyContinuationFrameAsync(int streamId, Http2ContinuationFrameFlags flags) { var outputWriter = _pair.Application.Output; @@ -911,14 +895,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests protected Task SendDataAsync(int streamId, Memory data, bool endStream) { var outputWriter = _pair.Application.Output; - var frame = new Http2Frame(); - - frame.PrepareData(streamId); - frame.PayloadLength = data.Length; - frame.DataFlags = endStream ? Http2DataFrameFlags.END_STREAM : Http2DataFrameFlags.NONE; - - Http2FrameWriter.WriteHeader(frame, outputWriter); - return SendAsync(data.Span); + outputWriter.WriteData(streamId, data, endStream); + return FlushAsync(outputWriter); } protected async Task SendDataWithPaddingAsync(int streamId, Memory data, byte padLength, bool endStream) diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TimeoutTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TimeoutTests.cs index 1d18ac20c0..02413c5805 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TimeoutTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TimeoutTests.cs @@ -101,7 +101,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests _mockTimeoutControl.Verify(c => c.SetTimeout(It.IsAny(), TimeoutReason.RequestHeaders), Times.Once); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -263,7 +263,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests } [Fact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/1323", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/1323")] public async Task DATA_Sent_TooSlowlyDueToSocketBackPressureOnSmallWrite_AbortsConnectionAfterGracePeriod() { var mockSystemClock = _serviceContext.MockSystemClock; @@ -283,7 +283,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloWorldBytes, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -316,7 +316,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task DATA_Sent_TooSlowlyDueToSocketBackPressureOnLargeWrite_AbortsConnectionAfterRateTimeout() { var mockSystemClock = _serviceContext.MockSystemClock; @@ -336,7 +336,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _maxData, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -390,7 +390,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloWorldBytes, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -444,7 +444,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _maxData, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -500,7 +500,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _maxData, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -512,7 +512,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(3, _maxData, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 3); await ExpectAsync(Http2FrameType.DATA, @@ -566,7 +566,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloWorldBytes, endStream: false); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -615,7 +615,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _maxData, endStream: false); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -668,7 +668,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _maxData, endStream: false); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -681,7 +681,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(3, _maxData, endStream: false); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 3); await ExpectAsync(Http2FrameType.DATA, @@ -737,7 +737,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _maxData, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -755,7 +755,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(3, _maxData, endStream: false); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 3); await ExpectAsync(Http2FrameType.DATA, @@ -812,7 +812,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloWorldBytes, endStream: false); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -884,7 +884,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(3, _helloWorldBytes, endStream: false); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 3); await ExpectAsync(Http2FrameType.DATA, @@ -901,7 +901,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests backpressureTcs.SetResult(null); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/Http3StreamTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/Http3StreamTests.cs index 860caa46c0..a0445ab86f 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/Http3StreamTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/Http3StreamTests.cs @@ -5,6 +5,7 @@ using System.Net.Http; using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Http.Features; +using Microsoft.AspNetCore.Testing; using Microsoft.Net.Http.Headers; using Xunit; @@ -263,6 +264,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests } [Fact] + [QuarantinedTest] public async Task MissingAuthority_200Status() { var headers = new[] diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionMiddlewareTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionMiddlewareTests.cs index 80780257e4..43e557734e 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionMiddlewareTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionMiddlewareTests.cs @@ -310,7 +310,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests } [Theory] - [Flaky("", FlakyOn.All)] [InlineData(HttpProtocols.Http1)] [InlineData(HttpProtocols.Http1AndHttp2)] // Make sure Http/1.1 doesn't regress with Http/2 enabled. public async Task CertificatePassedToHttpContext(HttpProtocols httpProtocols) @@ -391,7 +390,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests } [Theory] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/1976", FlakyOn.All)] [InlineData(ClientCertificateMode.AllowCertificate)] [InlineData(ClientCertificateMode.RequireCertificate)] public async Task ClientCertificateValidationGetsCalledWithNotNullParameters(ClientCertificateMode mode) @@ -426,7 +424,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests } [ConditionalTheory] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/1950", FlakyOn.Helix.All)] [InlineData(ClientCertificateMode.AllowCertificate)] [InlineData(ClientCertificateMode.RequireCertificate)] public async Task ValidationFailureRejectsConnection(ClientCertificateMode mode) diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/LoggingConnectionMiddlewareTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/LoggingConnectionMiddlewareTests.cs index dad6b54357..31539e50b3 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/LoggingConnectionMiddlewareTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/LoggingConnectionMiddlewareTests.cs @@ -14,7 +14,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests public class LoggingConnectionMiddlewareTests : LoggedTest { [Fact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2276", FlakyOn.Helix.All)] public async Task LoggingConnectionMiddlewareCanBeAddedBeforeAndAfterHttps() { await using (var server = new TestServer(context => diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/RequestTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/RequestTests.cs index a392e73f86..2e63e458ac 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/RequestTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/RequestTests.cs @@ -790,7 +790,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests } [Fact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2176", FlakyOn.All)] + [QuarantinedTest] public async Task ContentLengthReadAsyncSingleBytesAtATime() { var testContext = new TestServiceContext(LoggerFactory); diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/ResponseTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/ResponseTests.cs index c40b562eba..0dca63fe5f 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/ResponseTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/ResponseTests.cs @@ -2541,7 +2541,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests } [Fact] - [Flaky("https://github.com/dotnet/aspnetcore/issues/12401", FlakyOn.All)] + [QuarantinedTest] public async Task AppAbortViaIConnectionLifetimeFeatureIsLogged() { var testContext = new TestServiceContext(LoggerFactory); diff --git a/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs b/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs index d7b2066a3f..862adb0bb4 100644 --- a/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs +++ b/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs @@ -21,7 +21,7 @@ namespace Interop.FunctionalTests { [ConditionalTheory] [MemberData(nameof(H2SpecTestCases))] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2225", FlakyOn.Helix.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2225")] public async Task RunIndividualTestCase(H2SpecTestCase testCase) { var hostBuilder = new WebHostBuilder() diff --git a/src/Servers/Kestrel/test/Interop.FunctionalTests/HttpClientHttp2InteropTests.cs b/src/Servers/Kestrel/test/Interop.FunctionalTests/HttpClientHttp2InteropTests.cs index 59c212d2ed..9f3c3598bc 100644 --- a/src/Servers/Kestrel/test/Interop.FunctionalTests/HttpClientHttp2InteropTests.cs +++ b/src/Servers/Kestrel/test/Interop.FunctionalTests/HttpClientHttp2InteropTests.cs @@ -1024,7 +1024,7 @@ namespace Interop.FunctionalTests } [Theory] - [Flaky("https://github.com/dotnet/runtime/issues/860", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/runtime/issues/860")] [MemberData(nameof(SupportedSchemes))] public async Task RequestHeaders_MultipleFrames_Accepted(string scheme) { @@ -1118,7 +1118,7 @@ namespace Interop.FunctionalTests Assert.Equal(oneKbString + i, response.Headers.GetValues("header" + i).Single()); } - Assert.Single(TestSink.Writes.Where(context => context.Message.Contains("sending HEADERS frame for stream ID 1 with length 15636 and flags END_STREAM"))); + Assert.Single(TestSink.Writes.Where(context => context.Message.Contains("sending HEADERS frame for stream ID 1 with length 15612 and flags END_STREAM"))); Assert.Equal(2, TestSink.Writes.Where(context => context.Message.Contains("sending CONTINUATION frame for stream ID 1 with length 15585 and flags NONE")).Count()); Assert.Single(TestSink.Writes.Where(context => context.Message.Contains("sending CONTINUATION frame for stream ID 1 with length 14546 and flags END_HEADERS"))); @@ -1189,6 +1189,7 @@ namespace Interop.FunctionalTests // Nor does Kestrel yet support sending dynamic table updates, so there's nothing to test here. https://github.com/dotnet/aspnetcore/issues/4715 [Theory] + [QuarantinedTest] [MemberData(nameof(SupportedSchemes))] public async Task Settings_MaxConcurrentStreamsGet_Server(string scheme) { @@ -1346,7 +1347,7 @@ namespace Interop.FunctionalTests // Settings_MaxFrameSize_Larger_Client - Not configurable [Theory] - [Flaky("https://github.com/dotnet/runtime/issues/860", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/runtime/issues/860")] [MemberData(nameof(SupportedSchemes))] public async Task Settings_MaxHeaderListSize_Server(string scheme) { diff --git a/src/Shared/BenchmarkRunner/DefaultCoreConfig.cs b/src/Shared/BenchmarkRunner/DefaultCoreConfig.cs index 0691936c35..e5b0c9b43b 100644 --- a/src/Shared/BenchmarkRunner/DefaultCoreConfig.cs +++ b/src/Shared/BenchmarkRunner/DefaultCoreConfig.cs @@ -27,7 +27,7 @@ namespace BenchmarkDotNet.Attributes Add(JitOptimizationsValidator.FailOnError); - Add(Job.Core + Add(Job.Default #if NETCOREAPP2_1 .With(CsProjCoreToolchain.From(NetCoreAppSettings.NetCoreApp21)) #elif NETCOREAPP3_0 diff --git a/src/Shared/BenchmarkRunner/DefaultCorePerfLabConfig.cs b/src/Shared/BenchmarkRunner/DefaultCorePerfLabConfig.cs index 5cc809e166..5c6ba7ac3b 100644 --- a/src/Shared/BenchmarkRunner/DefaultCorePerfLabConfig.cs +++ b/src/Shared/BenchmarkRunner/DefaultCorePerfLabConfig.cs @@ -22,10 +22,7 @@ namespace BenchmarkDotNet.Attributes Add(MemoryDiagnoser.Default); Add(StatisticColumn.OperationsPerSecond); Add(new ParamsSummaryColumn()); - Add(DefaultColumnProviders.Statistics, DefaultColumnProviders.Diagnosers, DefaultColumnProviders.Target); - - // TODO: When upgrading to BDN 0.11.1, use Add(DefaultColumnProviders.Descriptor); - // DefaultColumnProviders.Target is deprecated + Add(DefaultColumnProviders.Statistics, DefaultColumnProviders.Metrics, DefaultColumnProviders.Descriptor); Add(JitOptimizationsValidator.FailOnError); @@ -36,13 +33,7 @@ namespace BenchmarkDotNet.Attributes Add(new CsvExporter( CsvSeparator.Comma, - new Reports.SummaryStyle - { - PrintUnitsInHeader = true, - PrintUnitsInContent = false, - TimeUnit = Horology.TimeUnit.Microsecond, - SizeUnit = SizeUnit.KB - })); + new Reports.SummaryStyle(printUnitsInHeader: true, printUnitsInContent: false, timeUnit: Horology.TimeUnit.Microsecond, sizeUnit: SizeUnit.KB))); } } } diff --git a/src/Shared/BenchmarkRunner/DefaultCoreValidationConfig.cs b/src/Shared/BenchmarkRunner/DefaultCoreValidationConfig.cs index 5a90929cff..3faf5ac1cb 100644 --- a/src/Shared/BenchmarkRunner/DefaultCoreValidationConfig.cs +++ b/src/Shared/BenchmarkRunner/DefaultCoreValidationConfig.cs @@ -4,7 +4,7 @@ using BenchmarkDotNet.Configs; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Loggers; -using BenchmarkDotNet.Toolchains.InProcess; +using BenchmarkDotNet.Toolchains.InProcess.NoEmit; namespace BenchmarkDotNet.Attributes { @@ -14,7 +14,7 @@ namespace BenchmarkDotNet.Attributes { Add(ConsoleLogger.Default); - Add(Job.Dry.With(InProcessToolchain.Instance)); + Add(Job.Dry.With(InProcessNoEmitToolchain.Instance)); } } } diff --git a/src/Shared/BenchmarkRunner/ParamsDisplayInfoColumn.cs b/src/Shared/BenchmarkRunner/ParamsDisplayInfoColumn.cs index b246e21c2e..2267de01a6 100644 --- a/src/Shared/BenchmarkRunner/ParamsDisplayInfoColumn.cs +++ b/src/Shared/BenchmarkRunner/ParamsDisplayInfoColumn.cs @@ -11,8 +11,8 @@ namespace BenchmarkDotNet.Attributes { public string Id => nameof(ParamsSummaryColumn); public string ColumnName { get; } = "Params"; - public bool IsDefault(Summary summary, Benchmark benchmark) => false; - public string GetValue(Summary summary, Benchmark benchmark) => benchmark.Parameters.DisplayInfo; + public bool IsDefault(Summary summary, BenchmarkCase benchmark) => false; + public string GetValue(Summary summary, BenchmarkCase benchmark) => benchmark.Parameters.DisplayInfo; public bool IsAvailable(Summary summary) => true; public bool AlwaysShow => true; public ColumnCategory Category => ColumnCategory.Params; @@ -20,7 +20,7 @@ namespace BenchmarkDotNet.Attributes public override string ToString() => ColumnName; public bool IsNumeric => false; public UnitType UnitType => UnitType.Dimensionless; - public string GetValue(Summary summary, Benchmark benchmark, ISummaryStyle style) => GetValue(summary, benchmark); + public string GetValue(Summary summary, BenchmarkCase benchmark, SummaryStyle style) => GetValue(summary, benchmark); public string Legend => $"Summary of all parameter values"; } -} \ No newline at end of file +} diff --git a/src/Shared/Http2cat/HPackHeaderWriter.cs b/src/Shared/Http2cat/HPackHeaderWriter.cs new file mode 100644 index 0000000000..27772caa72 --- /dev/null +++ b/src/Shared/Http2cat/HPackHeaderWriter.cs @@ -0,0 +1,91 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Net.Http; +using System.Net.Http.HPack; + +namespace Microsoft.AspNetCore.Http2Cat +{ + internal static class HPackHeaderWriter + { + /// + /// Begin encoding headers in the first HEADERS frame. + /// + public static bool BeginEncodeHeaders(int statusCode, IEnumerator> headersEnumerator, Span buffer, out int length) + { + if (!HPackEncoder.EncodeStatusHeader(statusCode, buffer, out var statusCodeLength)) + { + throw new HPackEncodingException(SR.net_http_hpack_encode_failure); + } + + if (!headersEnumerator.MoveNext()) + { + length = statusCodeLength; + return true; + } + + // We're ok with not throwing if no headers were encoded because we've already encoded the status. + // There is a small chance that the header will encode if there is no other content in the next HEADERS frame. + var done = EncodeHeaders(headersEnumerator, buffer.Slice(statusCodeLength), throwIfNoneEncoded: false, out var headersLength); + length = statusCodeLength + headersLength; + + return done; + } + + /// + /// Begin encoding headers in the first HEADERS frame. + /// + public static bool BeginEncodeHeaders(IEnumerator> headersEnumerator, Span buffer, out int length) + { + if (!headersEnumerator.MoveNext()) + { + length = 0; + return true; + } + + return EncodeHeaders(headersEnumerator, buffer, throwIfNoneEncoded: true, out length); + } + + /// + /// Continue encoding headers in the next HEADERS frame. The enumerator should already have a current value. + /// + public static bool ContinueEncodeHeaders(IEnumerator> headersEnumerator, Span buffer, out int length) + { + return EncodeHeaders(headersEnumerator, buffer, throwIfNoneEncoded: true, out length); + } + + private static bool EncodeHeaders(IEnumerator> headersEnumerator, Span buffer, bool throwIfNoneEncoded, out int length) + { + var currentLength = 0; + do + { + if (!EncodeHeader(headersEnumerator.Current.Key, headersEnumerator.Current.Value, buffer.Slice(currentLength), out int headerLength)) + { + // The the header wasn't written and no headers have been written then the header is too large. + // Throw an error to avoid an infinite loop of attempting to write large header. + if (currentLength == 0 && throwIfNoneEncoded) + { + throw new HPackEncodingException(SR.net_http_hpack_encode_failure); + } + + length = currentLength; + return false; + } + + currentLength += headerLength; + } + while (headersEnumerator.MoveNext()); + + length = currentLength; + + return true; + } + + private static bool EncodeHeader(string name, string value, Span buffer, out int length) + { + return HPackEncoder.EncodeLiteralHeaderFieldWithoutIndexingNewName(name, value, buffer, out length); + } + } +} diff --git a/src/Shared/Http2cat/Http2Utilities.cs b/src/Shared/Http2cat/Http2Utilities.cs index fecc6ed3bb..13a6ba4fc5 100644 --- a/src/Shared/Http2cat/Http2Utilities.cs +++ b/src/Shared/Http2cat/Http2Utilities.cs @@ -20,6 +20,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2; using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.Extensions.Logging; using Microsoft.Net.Http.Headers; +using IHttpHeadersHandler = System.Net.Http.IHttpHeadersHandler; namespace Microsoft.AspNetCore.Http2Cat { @@ -121,7 +122,6 @@ namespace Microsoft.AspNetCore.Http2Cat public static readonly byte[] _maxData = Encoding.ASCII.GetBytes(new string('a', Http2PeerSettings.MinAllowedMaxFrameSize)); internal readonly Http2PeerSettings _clientSettings = new Http2PeerSettings(); - internal readonly HPackEncoder _hpackEncoder = new HPackEncoder(); internal readonly HPackDecoder _hpackDecoder; private readonly byte[] _headerEncodingBuffer = new byte[Http2PeerSettings.MinAllowedMaxFrameSize]; @@ -235,7 +235,8 @@ namespace Microsoft.AspNetCore.Http2Cat frame.PrepareHeaders(Http2HeadersFrameFlags.NONE, streamId); var buffer = _headerEncodingBuffer.AsSpan(); - var done = _hpackEncoder.BeginEncode(headers, buffer, out var length); + var headersEnumerator = GetHeadersEnumerator(headers); + var done = HPackHeaderWriter.BeginEncodeHeaders(headersEnumerator, buffer, out var length); frame.PayloadLength = length; if (done) @@ -255,7 +256,7 @@ namespace Microsoft.AspNetCore.Http2Cat { frame.PrepareContinuation(Http2ContinuationFrameFlags.NONE, streamId); - done = _hpackEncoder.Encode(buffer, out length); + done = HPackHeaderWriter.ContinueEncodeHeaders(headersEnumerator, buffer, out length); frame.PayloadLength = length; if (done) @@ -270,6 +271,12 @@ namespace Microsoft.AspNetCore.Http2Cat return FlushAsync(writableBuffer); } + private static IEnumerator> GetHeadersEnumerator(IEnumerable> headers) + { + var headersEnumerator = headers.GetEnumerator(); + return headersEnumerator; + } + internal Dictionary DecodeHeaders(Http2FrameWithPayload frame, bool endHeaders = false) { Assert.Equal(Http2FrameType.HEADERS, frame.Type); @@ -334,7 +341,7 @@ namespace Microsoft.AspNetCore.Http2Cat extendedHeader[0] = padLength; var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); - _hpackEncoder.BeginEncode(headers, payload, out var length); + HPackHeaderWriter.BeginEncodeHeaders(GetHeadersEnumerator(headers), payload, out var length); var padding = buffer.Slice(extendedHeaderLength + length, padLength); padding.Fill(0); @@ -376,7 +383,7 @@ namespace Microsoft.AspNetCore.Http2Cat extendedHeader[4] = priority; var payload = buffer.Slice(extendedHeaderLength); - _hpackEncoder.BeginEncode(headers, payload, out var length); + HPackHeaderWriter.BeginEncodeHeaders(GetHeadersEnumerator(headers), payload, out var length); frame.PayloadLength = extendedHeaderLength + length; @@ -422,7 +429,7 @@ namespace Microsoft.AspNetCore.Http2Cat extendedHeader[5] = priority; var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); - _hpackEncoder.BeginEncode(headers, payload, out var length); + HPackHeaderWriter.BeginEncodeHeaders(GetHeadersEnumerator(headers), payload, out var length); var padding = buffer.Slice(extendedHeaderLength + length, padLength); padding.Fill(0); @@ -548,7 +555,7 @@ namespace Microsoft.AspNetCore.Http2Cat frame.PrepareHeaders(flags, streamId); var buffer = _headerEncodingBuffer.AsMemory(); - var done = _hpackEncoder.BeginEncode(headers, buffer.Span, out var length); + var done = HPackHeaderWriter.BeginEncodeHeaders(GetHeadersEnumerator(headers), buffer.Span, out var length); frame.PayloadLength = length; WriteHeader(frame, outputWriter); @@ -606,14 +613,14 @@ namespace Microsoft.AspNetCore.Http2Cat await SendAsync(payload); } - internal async Task SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags) + internal async Task SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, IEnumerator> headersEnumerator) { var outputWriter = _pair.Application.Output; var frame = new Http2Frame(); frame.PrepareContinuation(flags, streamId); var buffer = _headerEncodingBuffer.AsMemory(); - var done = _hpackEncoder.Encode(buffer.Span, out var length); + var done = HPackHeaderWriter.ContinueEncodeHeaders(headersEnumerator, buffer.Span, out var length); frame.PayloadLength = length; WriteHeader(frame, outputWriter); @@ -641,7 +648,7 @@ namespace Microsoft.AspNetCore.Http2Cat frame.PrepareContinuation(flags, streamId); var buffer = _headerEncodingBuffer.AsMemory(); - var done = _hpackEncoder.BeginEncode(headers, buffer.Span, out var length); + var done = HPackHeaderWriter.BeginEncodeHeaders(GetHeadersEnumerator(headers), buffer.Span, out var length); frame.PayloadLength = length; WriteHeader(frame, outputWriter); diff --git a/src/Shared/UrlDecoder/UrlDecoder.cs b/src/Shared/UrlDecoder/UrlDecoder.cs index 5666f5b34f..9e01c15d5e 100644 --- a/src/Shared/UrlDecoder/UrlDecoder.cs +++ b/src/Shared/UrlDecoder/UrlDecoder.cs @@ -20,7 +20,7 @@ namespace Microsoft.AspNetCore.Internal if (destination.Length < source.Length) { throw new ArgumentException( - "Lenghth of the destination byte span is less then the source.", + "Length of the destination byte span is less then the source.", nameof(destination)); } diff --git a/src/Shared/runtime/Http2/Hpack/DynamicTable.cs b/src/Shared/runtime/Http2/Hpack/DynamicTable.cs index 22178acae7..5a8fdf170f 100644 --- a/src/Shared/runtime/Http2/Hpack/DynamicTable.cs +++ b/src/Shared/runtime/Http2/Hpack/DynamicTable.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. namespace System.Net.Http.HPack { diff --git a/src/Shared/runtime/Http2/Hpack/H2StaticTable.cs b/src/Shared/runtime/Http2/Hpack/H2StaticTable.cs index eeb1029119..7f3b775582 100644 --- a/src/Shared/runtime/Http2/Hpack/H2StaticTable.cs +++ b/src/Shared/runtime/Http2/Hpack/H2StaticTable.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Collections.Generic; using System.Text; @@ -108,6 +108,7 @@ namespace System.Net.Http.HPack public const int PathSlash = 4; public const int SchemeHttp = 6; public const int SchemeHttps = 7; + public const int Status200 = 8; public const int AcceptCharset = 15; public const int AcceptEncoding = 16; public const int AcceptLanguage = 17; diff --git a/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs b/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs index 997047f2c6..41eb1c6938 100644 --- a/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs +++ b/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Buffers; using System.Diagnostics; diff --git a/src/Shared/runtime/Http2/Hpack/HPackDecodingException.cs b/src/Shared/runtime/Http2/Hpack/HPackDecodingException.cs index 63d80cbb9f..b30eba72b9 100644 --- a/src/Shared/runtime/Http2/Hpack/HPackDecodingException.cs +++ b/src/Shared/runtime/Http2/Hpack/HPackDecodingException.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Runtime.Serialization; diff --git a/src/Shared/runtime/Http2/Hpack/HPackEncoder.cs b/src/Shared/runtime/Http2/Hpack/HPackEncoder.cs index 52b21dcce3..15aec6cfa6 100644 --- a/src/Shared/runtime/Http2/Hpack/HPackEncoder.cs +++ b/src/Shared/runtime/Http2/Hpack/HPackEncoder.cs @@ -1,170 +1,13 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. -using System.Collections.Generic; using System.Diagnostics; namespace System.Net.Http.HPack { - internal class HPackEncoder + internal static class HPackEncoder { - private IEnumerator> _enumerator; - - public bool BeginEncode(IEnumerable> headers, Span buffer, out int length) - { - _enumerator = headers.GetEnumerator(); - _enumerator.MoveNext(); - - return Encode(buffer, out length); - } - - public bool BeginEncode(int statusCode, IEnumerable> headers, Span buffer, out int length) - { - _enumerator = headers.GetEnumerator(); - _enumerator.MoveNext(); - - int statusCodeLength = EncodeStatusCode(statusCode, buffer); - bool done = Encode(buffer.Slice(statusCodeLength), throwIfNoneEncoded: false, out int headersLength); - length = statusCodeLength + headersLength; - - return done; - } - - public bool Encode(Span buffer, out int length) - { - return Encode(buffer, throwIfNoneEncoded: true, out length); - } - - private bool Encode(Span buffer, bool throwIfNoneEncoded, out int length) - { - int currentLength = 0; - do - { - if (!EncodeHeader(_enumerator.Current.Key, _enumerator.Current.Value, buffer.Slice(currentLength), out int headerLength)) - { - if (currentLength == 0 && throwIfNoneEncoded) - { - throw new HPackEncodingException(SR.net_http_hpack_encode_failure); - } - - length = currentLength; - return false; - } - - currentLength += headerLength; - } - while (_enumerator.MoveNext()); - - length = currentLength; - - return true; - } - - private int EncodeStatusCode(int statusCode, Span buffer) - { - switch (statusCode) - { - // Status codes which exist in the HTTP/2 StaticTable. - case 200: - case 204: - case 206: - case 304: - case 400: - case 404: - case 500: - buffer[0] = (byte)(0x80 | H2StaticTable.StatusIndex[statusCode]); - return 1; - default: - // Send as Literal Header Field Without Indexing - Indexed Name - buffer[0] = 0x08; - - ReadOnlySpan statusBytes = StatusCodes.ToStatusBytes(statusCode); - buffer[1] = (byte)statusBytes.Length; - statusBytes.CopyTo(buffer.Slice(2)); - - return 2 + statusBytes.Length; - } - } - - private bool EncodeHeader(string name, string value, Span buffer, out int length) - { - int i = 0; - length = 0; - - if (buffer.Length == 0) - { - return false; - } - - buffer[i++] = 0; - - if (i == buffer.Length) - { - return false; - } - - if (!EncodeString(name, buffer.Slice(i), out int nameLength, lowercase: true)) - { - return false; - } - - i += nameLength; - - if (i >= buffer.Length) - { - return false; - } - - if (!EncodeString(value, buffer.Slice(i), out int valueLength, lowercase: false)) - { - return false; - } - - i += valueLength; - - length = i; - return true; - } - - private bool EncodeString(string value, Span destination, out int bytesWritten, bool lowercase) - { - // From https://tools.ietf.org/html/rfc7541#section-5.2 - // ------------------------------------------------------ - // 0 1 2 3 4 5 6 7 - // +---+---+---+---+---+---+---+---+ - // | H | String Length (7+) | - // +---+---------------------------+ - // | String Data (Length octets) | - // +-------------------------------+ - const int toLowerMask = 0x20; - - if (destination.Length != 0) - { - destination[0] = 0; // TODO: Use Huffman encoding - if (IntegerEncoder.Encode(value.Length, 7, destination, out int integerLength)) - { - Debug.Assert(integerLength >= 1); - - destination = destination.Slice(integerLength); - if (value.Length <= destination.Length) - { - for (int i = 0; i < value.Length; i++) - { - char c = value[i]; - destination[i] = (byte)(lowercase && (uint)(c - 'A') <= ('Z' - 'A') ? c | toLowerMask : c); - } - - bytesWritten = integerLength + value.Length; - return true; - } - } - } - - bytesWritten = 0; - return false; - } - // Things we should add: // * Huffman encoding // @@ -195,6 +38,43 @@ namespace System.Net.Http.HPack return false; } + /// Encodes the status code of a response to the :status field. + public static bool EncodeStatusHeader(int statusCode, Span destination, out int bytesWritten) + { + // Bytes written depend on whether the status code value maps directly to an index + switch (statusCode) + { + case 200: + case 204: + case 206: + case 304: + case 400: + case 404: + case 500: + // Status codes which exist in the HTTP/2 StaticTable. + return EncodeIndexedHeaderField(H2StaticTable.StatusIndex[statusCode], destination, out bytesWritten); + default: + // If the status code doesn't have a static index then we need to include the full value. + // Write a status index and then the number bytes as a string literal. + if (!EncodeLiteralHeaderFieldWithoutIndexing(H2StaticTable.Status200, destination, out var nameLength)) + { + bytesWritten = 0; + return false; + } + + var statusBytes = StatusCodes.ToStatusBytes(statusCode); + + if (!EncodeStringLiteral(statusBytes, destination.Slice(nameLength), out var valueLength)) + { + bytesWritten = 0; + return false; + } + + bytesWritten = nameLength + valueLength; + return true; + } + } + /// Encodes a "Literal Header Field without Indexing". public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, string value, Span destination, out int bytesWritten) { @@ -229,7 +109,7 @@ namespace System.Net.Http.HPack /// /// Encodes a "Literal Header Field without Indexing", but only the index portion; - /// a subsequent call to must be used to encode the associated value. + /// a subsequent call to EncodeStringLiteral must be used to encode the associated value. /// public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, Span destination, out int bytesWritten) { @@ -262,6 +142,39 @@ namespace System.Net.Http.HPack return false; } + /// Encodes a "Literal Header Field without Indexing - New Name". + public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, string value, Span destination, out int bytesWritten) + { + // From https://tools.ietf.org/html/rfc7541#section-6.2.2 + // ------------------------------------------------------ + // 0 1 2 3 4 5 6 7 + // +---+---+---+---+---+---+---+---+ + // | 0 | 0 | 0 | 0 | 0 | + // +---+---+-----------------------+ + // | H | Name Length (7+) | + // +---+---------------------------+ + // | Name String (Length octets) | + // +---+---------------------------+ + // | H | Value Length (7+) | + // +---+---------------------------+ + // | Value String (Length octets) | + // +-------------------------------+ + + if ((uint)destination.Length >= 3) + { + destination[0] = 0; + if (EncodeLiteralHeaderName(name, destination.Slice(1), out int nameLength) && + EncodeStringLiteral(value, destination.Slice(1 + nameLength), out int valueLength)) + { + bytesWritten = 1 + nameLength + valueLength; + return true; + } + } + + bytesWritten = 0; + return false; + } + /// Encodes a "Literal Header Field without Indexing - New Name". public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, ReadOnlySpan values, string separator, Span destination, out int bytesWritten) { @@ -297,7 +210,7 @@ namespace System.Net.Http.HPack /// /// Encodes a "Literal Header Field without Indexing - New Name", but only the name portion; - /// a subsequent call to must be used to encode the associated value. + /// a subsequent call to EncodeStringLiteral must be used to encode the associated value. /// public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, Span destination, out int bytesWritten) { @@ -393,6 +306,40 @@ namespace System.Net.Http.HPack return false; } + public static bool EncodeStringLiteral(ReadOnlySpan value, Span destination, out int bytesWritten) + { + // From https://tools.ietf.org/html/rfc7541#section-5.2 + // ------------------------------------------------------ + // 0 1 2 3 4 5 6 7 + // +---+---+---+---+---+---+---+---+ + // | H | String Length (7+) | + // +---+---------------------------+ + // | String Data (Length octets) | + // +-------------------------------+ + + if (destination.Length != 0) + { + destination[0] = 0; // TODO: Use Huffman encoding + if (IntegerEncoder.Encode(value.Length, 7, destination, out int integerLength)) + { + Debug.Assert(integerLength >= 1); + + destination = destination.Slice(integerLength); + if (value.Length <= destination.Length) + { + // Note: No validation. Bytes should have already been validated. + value.CopyTo(destination); + + bytesWritten = integerLength + value.Length; + return true; + } + } + } + + bytesWritten = 0; + return false; + } + public static bool EncodeStringLiteral(string value, Span destination, out int bytesWritten) { // From https://tools.ietf.org/html/rfc7541#section-5.2 @@ -481,7 +428,7 @@ namespace System.Net.Http.HPack /// /// Encodes a "Literal Header Field without Indexing" to a new array, but only the index portion; - /// a subsequent call to must be used to encode the associated value. + /// a subsequent call to EncodeStringLiteral must be used to encode the associated value. /// public static byte[] EncodeLiteralHeaderFieldWithoutIndexingToAllocatedArray(int index) { @@ -493,7 +440,7 @@ namespace System.Net.Http.HPack /// /// Encodes a "Literal Header Field without Indexing - New Name" to a new array, but only the name portion; - /// a subsequent call to must be used to encode the associated value. + /// a subsequent call to EncodeStringLiteral must be used to encode the associated value. /// public static byte[] EncodeLiteralHeaderFieldWithoutIndexingNewNameToAllocatedArray(string name) { diff --git a/src/Shared/runtime/Http2/Hpack/HPackEncodingException.cs b/src/Shared/runtime/Http2/Hpack/HPackEncodingException.cs index 397b313191..792c871837 100644 --- a/src/Shared/runtime/Http2/Hpack/HPackEncodingException.cs +++ b/src/Shared/runtime/Http2/Hpack/HPackEncodingException.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. namespace System.Net.Http.HPack { diff --git a/src/Shared/runtime/Http2/Hpack/HeaderField.cs b/src/Shared/runtime/Http2/Hpack/HeaderField.cs index f876204671..2384c71983 100644 --- a/src/Shared/runtime/Http2/Hpack/HeaderField.cs +++ b/src/Shared/runtime/Http2/Hpack/HeaderField.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Diagnostics; using System.Text; diff --git a/src/Shared/runtime/Http2/Hpack/Huffman.cs b/src/Shared/runtime/Http2/Hpack/Huffman.cs index 3cba01b1d2..c534e0c173 100644 --- a/src/Shared/runtime/Http2/Hpack/Huffman.cs +++ b/src/Shared/runtime/Http2/Hpack/Huffman.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Diagnostics; diff --git a/src/Shared/runtime/Http2/Hpack/HuffmanDecodingException.cs b/src/Shared/runtime/Http2/Hpack/HuffmanDecodingException.cs index 64352e9535..2442f02da0 100644 --- a/src/Shared/runtime/Http2/Hpack/HuffmanDecodingException.cs +++ b/src/Shared/runtime/Http2/Hpack/HuffmanDecodingException.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Runtime.Serialization; diff --git a/src/Shared/runtime/Http2/Hpack/IntegerDecoder.cs b/src/Shared/runtime/Http2/Hpack/IntegerDecoder.cs index dafa6c08b4..0841d69bf2 100644 --- a/src/Shared/runtime/Http2/Hpack/IntegerDecoder.cs +++ b/src/Shared/runtime/Http2/Hpack/IntegerDecoder.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Diagnostics; using System.Numerics; diff --git a/src/Shared/runtime/Http2/Hpack/IntegerEncoder.cs b/src/Shared/runtime/Http2/Hpack/IntegerEncoder.cs index f56ad0a85e..227fbf0a44 100644 --- a/src/Shared/runtime/Http2/Hpack/IntegerEncoder.cs +++ b/src/Shared/runtime/Http2/Hpack/IntegerEncoder.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Diagnostics; diff --git a/src/Shared/runtime/Http2/Hpack/StatusCodes.cs b/src/Shared/runtime/Http2/Hpack/StatusCodes.cs index f302e7339b..b701fa79f4 100644 --- a/src/Shared/runtime/Http2/Hpack/StatusCodes.cs +++ b/src/Shared/runtime/Http2/Hpack/StatusCodes.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Globalization; using System.Text; diff --git a/src/Shared/runtime/Quic/Implementations/MsQuic/Internal/MsQuicApi.cs b/src/Shared/runtime/Quic/Implementations/MsQuic/Internal/MsQuicApi.cs index fb6330c024..977af1da93 100644 --- a/src/Shared/runtime/Quic/Implementations/MsQuic/Internal/MsQuicApi.cs +++ b/src/Shared/runtime/Quic/Implementations/MsQuic/Internal/MsQuicApi.cs @@ -236,8 +236,8 @@ namespace System.Net.Quic.Implementations.MsQuic.Internal { fileParams = new MsQuicNativeMethods.CertFileParams { - CertificateFilePath = Marshal.StringToCoTaskMemUTF8(certFilePath), - PrivateKeyFilePath = Marshal.StringToCoTaskMemUTF8(privateKeyFilePath) + PrivateKeyFilePath = Marshal.StringToCoTaskMemUTF8(privateKeyFilePath), + CertificateFilePath = Marshal.StringToCoTaskMemUTF8(certFilePath) }; unmanagedAddr = Marshal.AllocHGlobal(Marshal.SizeOf(fileParams)); @@ -246,7 +246,7 @@ namespace System.Net.Quic.Implementations.MsQuic.Internal createConfigStatus = SecConfigCreateDelegate( _registrationContext, (uint)QUIC_SEC_CONFIG_FLAG.CERT_FILE, - certificate.Handle, + unmanagedAddr, null, IntPtr.Zero, SecCfgCreateCallbackHandler); diff --git a/src/Shared/runtime/Quic/Implementations/MsQuic/Internal/ResettableCompletionSource.cs b/src/Shared/runtime/Quic/Implementations/MsQuic/Internal/ResettableCompletionSource.cs index 1db5dc67b4..4bcf0a917a 100644 --- a/src/Shared/runtime/Quic/Implementations/MsQuic/Internal/ResettableCompletionSource.cs +++ b/src/Shared/runtime/Quic/Implementations/MsQuic/Internal/ResettableCompletionSource.cs @@ -1,4 +1,8 @@ -using System.Threading.Tasks; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Threading.Tasks; using System.Threading.Tasks.Sources; namespace System.Net.Quic.Implementations.MsQuic.Internal diff --git a/src/Shared/runtime/Quic/Interop/MsQuicNativeMethods.cs b/src/Shared/runtime/Quic/Interop/MsQuicNativeMethods.cs index aca6b41a58..6f7edba173 100644 --- a/src/Shared/runtime/Quic/Interop/MsQuicNativeMethods.cs +++ b/src/Shared/runtime/Quic/Interop/MsQuicNativeMethods.cs @@ -1,4 +1,4 @@ -// 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. // See the LICENSE file in the project root for more information. @@ -481,8 +481,8 @@ namespace System.Net.Quic.Implementations.MsQuic.Internal [StructLayout(LayoutKind.Sequential)] internal struct CertFileParams { - internal IntPtr CertificateFilePath; internal IntPtr PrivateKeyFilePath; + internal IntPtr CertificateFilePath; } } } diff --git a/src/Shared/test/Shared.Tests/runtime/Http2/DynamicTableTest.cs b/src/Shared/test/Shared.Tests/runtime/Http2/DynamicTableTest.cs index fe0e4c7ec5..4abe4c5e68 100644 --- a/src/Shared/test/Shared.Tests/runtime/Http2/DynamicTableTest.cs +++ b/src/Shared/test/Shared.Tests/runtime/Http2/DynamicTableTest.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Collections.Generic; using System.Diagnostics; diff --git a/src/Shared/test/Shared.Tests/runtime/Http2/HPackDecoderTest.cs b/src/Shared/test/Shared.Tests/runtime/Http2/HPackDecoderTest.cs index d7bd47845c..2afdb29901 100644 --- a/src/Shared/test/Shared.Tests/runtime/Http2/HPackDecoderTest.cs +++ b/src/Shared/test/Shared.Tests/runtime/Http2/HPackDecoderTest.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Buffers; using System.Linq; diff --git a/src/SignalR/clients/csharp/Client/test/FunctionalTests/HubConnectionTests.cs b/src/SignalR/clients/csharp/Client/test/FunctionalTests/HubConnectionTests.cs index 539caf8c85..2220685e82 100644 --- a/src/SignalR/clients/csharp/Client/test/FunctionalTests/HubConnectionTests.cs +++ b/src/SignalR/clients/csharp/Client/test/FunctionalTests/HubConnectionTests.cs @@ -520,7 +520,6 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests [Theory] [MemberData(nameof(HubProtocolsAndTransportsAndHubPaths))] [LogLevel(LogLevel.Trace)] - [Flaky("", FlakyOn.All)] public async Task StreamAsyncTest(string protocolName, HttpTransportType transportType, string path) { var protocol = HubProtocols[protocolName]; diff --git a/src/SignalR/clients/csharp/Client/test/FunctionalTests/HubProtocolVersionTests.cs b/src/SignalR/clients/csharp/Client/test/FunctionalTests/HubProtocolVersionTests.cs index 7a288d1b60..b7f3206313 100644 --- a/src/SignalR/clients/csharp/Client/test/FunctionalTests/HubProtocolVersionTests.cs +++ b/src/SignalR/clients/csharp/Client/test/FunctionalTests/HubProtocolVersionTests.cs @@ -65,7 +65,6 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests [Theory] [MemberData(nameof(TransportTypes))] - [Flaky("", FlakyOn.All)] public async Task ClientUsingOldCallWithNewProtocol(HttpTransportType transportType) { using (var server = await StartServer()) @@ -99,7 +98,6 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests [Theory] [MemberData(nameof(TransportTypes))] - [Flaky("", FlakyOn.All)] public async Task ClientUsingNewCallWithNewProtocol(HttpTransportType transportType) { using (var server = await StartServer()) diff --git a/src/SignalR/clients/csharp/Client/test/UnitTests/HttpConnectionTests.Transport.cs b/src/SignalR/clients/csharp/Client/test/UnitTests/HttpConnectionTests.Transport.cs index 0244af0afd..a15f18faa1 100644 --- a/src/SignalR/clients/csharp/Client/test/UnitTests/HttpConnectionTests.Transport.cs +++ b/src/SignalR/clients/csharp/Client/test/UnitTests/HttpConnectionTests.Transport.cs @@ -15,6 +15,7 @@ using Microsoft.AspNetCore.Http.Connections; using Microsoft.AspNetCore.Http.Connections.Client; using Microsoft.AspNetCore.Http.Connections.Client.Internal; using Microsoft.AspNetCore.SignalR.Tests; +using Microsoft.Net.Http.Headers; using Xunit; namespace Microsoft.AspNetCore.SignalR.Client.Tests @@ -162,7 +163,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests testHttpHandler.OnRequest(async (request, next, token) => { - var requestedWithHeader = request.Headers.GetValues("X-Requested-With"); + var requestedWithHeader = request.Headers.GetValues(HeaderNames.XRequestedWith); var requestedWithValue = Assert.Single(requestedWithHeader); Assert.Equal("XMLHttpRequest", requestedWithValue); diff --git a/src/SignalR/clients/ts/FunctionalTests/ts/HubConnectionTests.ts b/src/SignalR/clients/ts/FunctionalTests/ts/HubConnectionTests.ts index 61b43e0654..93275f5336 100644 --- a/src/SignalR/clients/ts/FunctionalTests/ts/HubConnectionTests.ts +++ b/src/SignalR/clients/ts/FunctionalTests/ts/HubConnectionTests.ts @@ -679,7 +679,6 @@ describe("hubConnection", () => { if (transportType !== HttpTransportType.LongPolling) { it("terminates if no messages received within timeout interval", async (done) => { const hubConnection = getConnectionBuilder(transportType).build(); - hubConnection.serverTimeoutInMilliseconds = 100; hubConnection.onclose((error) => { expect(error).toEqual(new Error("Server timeout elapsed without receiving a message from the server.")); @@ -687,6 +686,12 @@ describe("hubConnection", () => { }); await hubConnection.start(); + + // set this after start completes to avoid network issues with the handshake taking over 100ms and causing a failure + hubConnection.serverTimeoutInMilliseconds = 1; + + // invoke a method with a response to reset the timeout using the new value + await hubConnection.invoke("Echo", ""); }); } diff --git a/src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs b/src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs index 664a794324..34626ca05b 100644 --- a/src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs +++ b/src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs @@ -1295,7 +1295,6 @@ namespace Microsoft.AspNetCore.Http.Connections.Tests } [Fact] - [Flaky("", FlakyOn.All)] public async Task RequestToActiveConnectionIdKillsPreviousConnectionLongPolling() { using (StartVerifiableLog()) diff --git a/src/SignalR/server/SignalR/test/EndToEndTests.cs b/src/SignalR/server/SignalR/test/EndToEndTests.cs index f45b8fab36..e2b22a2d6e 100644 --- a/src/SignalR/server/SignalR/test/EndToEndTests.cs +++ b/src/SignalR/server/SignalR/test/EndToEndTests.cs @@ -308,7 +308,6 @@ namespace Microsoft.AspNetCore.SignalR.Tests } [ConditionalTheory] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/1383", FlakyOn.All)] [WebSocketsSupportedCondition] [InlineData(5 * 4096)] [InlineData(1000 * 4096 + 32)] diff --git a/src/SignalR/server/SignalR/test/HubConnectionHandlerTests.cs b/src/SignalR/server/SignalR/test/HubConnectionHandlerTests.cs index d8da665a50..aaf4cfa582 100644 --- a/src/SignalR/server/SignalR/test/HubConnectionHandlerTests.cs +++ b/src/SignalR/server/SignalR/test/HubConnectionHandlerTests.cs @@ -1039,7 +1039,6 @@ namespace Microsoft.AspNetCore.SignalR.Tests } [Fact] - [Flaky("", FlakyOn.All)] public async Task HubMethodCanBeRenamedWithAttribute() { using (StartVerifiableLog()) @@ -2770,6 +2769,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests } [Fact] + [QuarantinedTest] public async Task ReceivingMessagesPreventsConnectionTimeoutFromOccuring() { using (StartVerifiableLog()) diff --git a/src/SignalR/server/SignalR/test/WebSocketsTransportTests.cs b/src/SignalR/server/SignalR/test/WebSocketsTransportTests.cs index 70b985851f..2c059c3edc 100644 --- a/src/SignalR/server/SignalR/test/WebSocketsTransportTests.cs +++ b/src/SignalR/server/SignalR/test/WebSocketsTransportTests.cs @@ -13,6 +13,7 @@ using Microsoft.AspNetCore.Connections; using Microsoft.AspNetCore.Http.Connections.Client; using Microsoft.AspNetCore.Http.Connections.Client.Internal; using Microsoft.AspNetCore.Testing; +using Microsoft.Net.Http.Headers; using Moq; using Xunit; @@ -103,7 +104,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests await webSocketsTransport.StartAsync(new Uri(server.WebSocketsUrl + "/httpheader"), TransferFormat.Binary).OrTimeout(); - await webSocketsTransport.Output.WriteAsync(Encoding.UTF8.GetBytes("X-Requested-With")); + await webSocketsTransport.Output.WriteAsync(Encoding.UTF8.GetBytes(HeaderNames.XRequestedWith)); // The HTTP header endpoint closes the connection immediately after sending response which should stop the transport await webSocketsTransport.Running.OrTimeout(); diff --git a/src/Testing/src/FlakyOn.cs b/src/Testing/src/FlakyOn.cs deleted file mode 100644 index 81d9299043..0000000000 --- a/src/Testing/src/FlakyOn.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Microsoft.AspNetCore.Testing -{ - public static class FlakyOn - { - public const string All = "All"; - - public static class Helix - { - public const string All = QueuePrefix + "All"; - - public const string Fedora28Amd64 = QueuePrefix + HelixQueues.Fedora28Amd64; - public const string Fedora27Amd64 = QueuePrefix + HelixQueues.Fedora27Amd64; - public const string Redhat7Amd64 = QueuePrefix + HelixQueues.Redhat7Amd64; - public const string Debian9Amd64 = QueuePrefix + HelixQueues.Debian9Amd64; - public const string Debian8Amd64 = QueuePrefix + HelixQueues.Debian8Amd64; - public const string Centos7Amd64 = QueuePrefix + HelixQueues.Centos7Amd64; - public const string Ubuntu1604Amd64 = QueuePrefix + HelixQueues.Ubuntu1604Amd64; - public const string Ubuntu1810Amd64 = QueuePrefix + HelixQueues.Ubuntu1810Amd64; - public const string macOS1012Amd64 = QueuePrefix + HelixQueues.macOS1012Amd64; - public const string Windows10Amd64 = QueuePrefix + HelixQueues.Windows10Amd64; - - private const string Prefix = "Helix:"; - private const string QueuePrefix = Prefix + "Queue:"; - } - - public static class AzP - { - public const string All = Prefix + "All"; - public const string Windows = OsPrefix + "Windows_NT"; - public const string macOS = OsPrefix + "Darwin"; - public const string Linux = OsPrefix + "Linux"; - - private const string Prefix = "AzP:"; - private const string OsPrefix = Prefix + "OS:"; - } - } -} diff --git a/src/Testing/src/xunit/FlakyAttribute.cs b/src/Testing/src/xunit/FlakyAttribute.cs deleted file mode 100644 index f77c56dfc0..0000000000 --- a/src/Testing/src/xunit/FlakyAttribute.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using System.Collections.Generic; -using Xunit.Sdk; - -namespace Microsoft.AspNetCore.Testing -{ - /// - /// Marks a test as "Flaky" so that the build will sequester it and ignore failures. - /// - /// - /// - /// This attribute works by applying xUnit.net "Traits" based on the criteria specified in the attribute - /// properties. Once these traits are applied, build scripts can include/exclude tests based on them. - /// - /// - /// All flakiness-related traits start with Flaky: and are grouped first by the process running the tests: Azure Pipelines (AzP) or Helix. - /// Then there is a segment specifying the "selector" which indicates where the test is flaky. Finally a segment specifying the value of that selector. - /// The value of these traits is always either "true" or the trait is not present. We encode the entire selector in the name of the trait because xUnit.net only - /// provides "==" and "!=" operators for traits, there is no way to check if a trait "contains" or "does not contain" a value. VSTest does support "contains" checks - /// but does not appear to support "does not contain" checks. Using this pattern means we can use simple "==" and "!=" checks to either only run flaky tests, or exclude - /// flaky tests. - /// - /// - /// - /// - /// [Fact] - /// [Flaky("...", HelixQueues.Fedora28Amd64, AzurePipelines.macOS)] - /// public void FlakyTest() - /// { - /// // Flakiness - /// } - /// - /// - /// - /// The above example generates the following facets: - /// - /// - /// - /// - /// Flaky:Helix:Queue:Fedora.28.Amd64.Open = true - /// - /// - /// Flaky:AzP:OS:Darwin = true - /// - /// - /// - /// - /// Given the above attribute, the Azure Pipelines macOS run can easily filter this test out by passing -notrait "Flaky:AzP:OS:all=true" -notrait "Flaky:AzP:OS:Darwin=true" - /// to xunit.console.exe. Similarly, it can run only flaky tests using -trait "Flaky:AzP:OS:all=true" -trait "Flaky:AzP:OS:Darwin=true" - /// - /// - [TraitDiscoverer("Microsoft.AspNetCore.Testing." + nameof(FlakyTraitDiscoverer), "Microsoft.AspNetCore.Testing")] - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)] - public sealed class FlakyAttribute : Attribute, ITraitAttribute - { - /// - /// Gets a URL to a GitHub issue tracking this flaky test. - /// - public string GitHubIssueUrl { get; } - - public IReadOnlyList Filters { get; } - - /// - /// Initializes a new instance of the class with the specified and a list of . If no - /// filters are provided, the test is considered flaky in all environments. - /// - /// - /// At least one filter is required. - /// - /// The URL to a GitHub issue tracking this flaky test. - /// The first filter that indicates where the test is flaky. Use a value from . - /// A list of additional filters that define where this test is flaky. Use values in . - public FlakyAttribute(string gitHubIssueUrl, string firstFilter, params string[] additionalFilters) - { - if (string.IsNullOrEmpty(gitHubIssueUrl)) - { - throw new ArgumentNullException(nameof(gitHubIssueUrl)); - } - - if (string.IsNullOrEmpty(firstFilter)) - { - throw new ArgumentNullException(nameof(firstFilter)); - } - - GitHubIssueUrl = gitHubIssueUrl; - var filters = new List(); - filters.Add(firstFilter); - filters.AddRange(additionalFilters); - Filters = filters; - } - } -} diff --git a/src/Testing/src/xunit/FlakyTraitDiscoverer.cs b/src/Testing/src/xunit/FlakyTraitDiscoverer.cs deleted file mode 100644 index 4e6bc27b1b..0000000000 --- a/src/Testing/src/xunit/FlakyTraitDiscoverer.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; -using Xunit.Abstractions; -using Xunit.Sdk; - -// Do not change this namespace without changing the usage in FlakyAttribute -namespace Microsoft.AspNetCore.Testing -{ - public class FlakyTraitDiscoverer : ITraitDiscoverer - { - public IEnumerable> GetTraits(IAttributeInfo traitAttribute) - { - if (traitAttribute is ReflectionAttributeInfo attribute && attribute.Attribute is FlakyAttribute flakyAttribute) - { - return GetTraitsCore(flakyAttribute); - } - else - { - throw new InvalidOperationException("The 'Flaky' attribute is only supported via reflection."); - } - } - - private IEnumerable> GetTraitsCore(FlakyAttribute attribute) - { - if (attribute.Filters.Count > 0) - { - foreach (var filter in attribute.Filters) - { - yield return new KeyValuePair($"Flaky:{filter}", "true"); - } - } - else - { - yield return new KeyValuePair($"Flaky:All", "true"); - } - } - } -} diff --git a/src/Testing/src/xunit/QuarantinedTestAttribute.cs b/src/Testing/src/xunit/QuarantinedTestAttribute.cs new file mode 100644 index 0000000000..350dcf1e12 --- /dev/null +++ b/src/Testing/src/xunit/QuarantinedTestAttribute.cs @@ -0,0 +1,57 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using Xunit.Sdk; + +namespace Microsoft.AspNetCore.Testing +{ + /// + /// Marks a test as "Quarantined" so that the build will sequester it and ignore failures. + /// + /// + /// + /// This attribute works by applying xUnit.net "Traits" based on the criteria specified in the attribute + /// properties. Once these traits are applied, build scripts can include/exclude tests based on them. + /// + /// + /// + /// + /// [Fact] + /// [QuarantinedTest] + /// public void FlakyTest() + /// { + /// // Flakiness + /// } + /// + /// + /// + /// The above example generates the following facet: + /// + /// + /// + /// + /// Quarantined = true + /// + /// + /// + [TraitDiscoverer("Microsoft.AspNetCore.Testing." + nameof(QuarantinedTestTraitDiscoverer), "Microsoft.AspNetCore.Testing")] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)] + public sealed class QuarantinedTestAttribute : Attribute, ITraitAttribute + { + /// + /// Gets an optional reason for the quarantining, such as a link to a GitHub issue URL with more details as to why the test is quarantined. + /// + public string Reason { get; } + + /// + /// Initializes a new instance of the class with an optional . + /// + /// A reason that this test is quarantined. + public QuarantinedTestAttribute(string reason = null) + { + Reason = reason; + } + } +} diff --git a/src/Testing/src/xunit/QuarantinedTestTraitDiscoverer.cs b/src/Testing/src/xunit/QuarantinedTestTraitDiscoverer.cs new file mode 100644 index 0000000000..256e2b6cfc --- /dev/null +++ b/src/Testing/src/xunit/QuarantinedTestTraitDiscoverer.cs @@ -0,0 +1,26 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using Xunit.Abstractions; +using Xunit.Sdk; + +// Do not change this namespace without changing the usage in QuarantinedTestAttribute +namespace Microsoft.AspNetCore.Testing +{ + public class QuarantinedTestTraitDiscoverer : ITraitDiscoverer + { + public IEnumerable> GetTraits(IAttributeInfo traitAttribute) + { + if (traitAttribute is ReflectionAttributeInfo attribute && attribute.Attribute is QuarantinedTestAttribute quarantinedTestAttribute) + { + yield return new KeyValuePair("Quarantined", "true"); + } + else + { + throw new InvalidOperationException("The 'QuarantinedTest' attribute is only supported via reflection."); + } + } + } +} diff --git a/src/Testing/test/FlakyAttributeTest.cs b/src/Testing/test/FlakyAttributeTest.cs deleted file mode 100644 index ae06e5cf50..0000000000 --- a/src/Testing/test/FlakyAttributeTest.cs +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using Xunit; - -namespace Microsoft.AspNetCore.Testing.Tests -{ - public class FlakyAttributeTest - { - [Fact(Skip = "These tests are nice when you need them but annoying when on all the time.")] - [Flaky("http://example.com", FlakyOn.All)] - public void AlwaysFlakyInCI() - { - if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX")) || !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("AGENT_OS"))) - { - throw new Exception("Flaky!"); - } - } - - [Fact(Skip = "These tests are nice when you need them but annoying when on all the time.")] - [Flaky("http://example.com", FlakyOn.Helix.All)] - public void FlakyInHelixOnly() - { - if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX"))) - { - throw new Exception("Flaky on Helix!"); - } - } - - [Fact(Skip = "These tests are nice when you need them but annoying when on all the time.")] - [Flaky("http://example.com", FlakyOn.Helix.macOS1012Amd64, FlakyOn.Helix.Fedora28Amd64)] - public void FlakyInSpecificHelixQueue() - { - // Today we don't run Extensions tests on Helix, but this test should light up when we do. - var queueName = Environment.GetEnvironmentVariable("HELIX"); - if (!string.IsNullOrEmpty(queueName)) - { - var failingQueues = new HashSet(StringComparer.OrdinalIgnoreCase) { HelixQueues.macOS1012Amd64, HelixQueues.Fedora28Amd64 }; - if (failingQueues.Contains(queueName)) - { - throw new Exception($"Flaky on Helix Queue '{queueName}' !"); - } - } - } - - [Fact(Skip = "These tests are nice when you need them but annoying when on all the time.")] - [Flaky("http://example.com", FlakyOn.AzP.All)] - public void FlakyInAzPOnly() - { - if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("AGENT_OS"))) - { - throw new Exception("Flaky on AzP!"); - } - } - - [Fact(Skip = "These tests are nice when you need them but annoying when on all the time.")] - [Flaky("http://example.com", FlakyOn.AzP.Windows)] - public void FlakyInAzPWindowsOnly() - { - if (string.Equals(Environment.GetEnvironmentVariable("AGENT_OS"), "Windows_NT")) - { - throw new Exception("Flaky on AzP Windows!"); - } - } - - [Fact(Skip = "These tests are nice when you need them but annoying when on all the time.")] - [Flaky("http://example.com", FlakyOn.AzP.macOS)] - public void FlakyInAzPmacOSOnly() - { - if (string.Equals(Environment.GetEnvironmentVariable("AGENT_OS"), "Darwin")) - { - throw new Exception("Flaky on AzP macOS!"); - } - } - - [Fact(Skip = "These tests are nice when you need them but annoying when on all the time.")] - [Flaky("http://example.com", FlakyOn.AzP.Linux)] - public void FlakyInAzPLinuxOnly() - { - if (string.Equals(Environment.GetEnvironmentVariable("AGENT_OS"), "Linux")) - { - throw new Exception("Flaky on AzP Linux!"); - } - } - - [Fact(Skip = "These tests are nice when you need them but annoying when on all the time.")] - [Flaky("http://example.com", FlakyOn.AzP.Linux, FlakyOn.AzP.macOS)] - public void FlakyInAzPNonWindowsOnly() - { - var agentOs = Environment.GetEnvironmentVariable("AGENT_OS"); - if (string.Equals(agentOs, "Linux") || string.Equals(agentOs, "Darwin")) - { - throw new Exception("Flaky on AzP non-Windows!"); - } - } - } -} diff --git a/src/Testing/test/QuarantinedTestAttributeTest.cs b/src/Testing/test/QuarantinedTestAttributeTest.cs new file mode 100644 index 0000000000..5fc6c58041 --- /dev/null +++ b/src/Testing/test/QuarantinedTestAttributeTest.cs @@ -0,0 +1,22 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using Xunit; + +namespace Microsoft.AspNetCore.Testing.Tests +{ + public class QuarantinedTestAttributeTest + { + [Fact(Skip = "These tests are nice when you need them but annoying when on all the time.")] + [QuarantinedTest] + public void AlwaysFlakyInCI() + { + if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX")) || !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("AGENT_OS"))) + { + throw new Exception("Flaky!"); + } + } + } +} diff --git a/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddURLTests.cs b/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddURLTests.cs index 26c9d3c1a1..0336cfdef2 100644 --- a/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddURLTests.cs +++ b/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddURLTests.cs @@ -17,7 +17,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests public OpenApiAddURLTests(ITestOutputHelper output) : base(output){ } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task OpenApi_Add_Url_WithContentDisposition() { var project = CreateBasicProject(withOpenApi: false); @@ -50,7 +50,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task OpenAPI_Add_Url_NoContentDisposition() { var project = CreateBasicProject(withOpenApi: false); @@ -84,7 +84,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task OpenAPI_Add_Url_NoExtension_AssumesJson() { var project = CreateBasicProject(withOpenApi: false); @@ -118,7 +118,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task OpenApi_Add_Url_NoSegment() { var project = CreateBasicProject(withOpenApi: false); @@ -152,7 +152,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task OpenApi_Add_Url() { var project = CreateBasicProject(withOpenApi: false); @@ -185,7 +185,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task OpenApi_Add_Url_SameName_UniqueFile() { var project = CreateBasicProject(withOpenApi: false); @@ -246,7 +246,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task OpenApi_Add_Url_NSwagCSharp() { var project = CreateBasicProject(withOpenApi: false); @@ -279,7 +279,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task OpenApi_Add_Url_NSwagTypeScript() { var project = CreateBasicProject(withOpenApi: false); @@ -312,7 +312,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task OpenApi_Add_Url_OutputFile() { var project = CreateBasicProject(withOpenApi: false); @@ -345,7 +345,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task OpenApi_Add_URL_FileAlreadyExists_Fail() { var project = CreateBasicProject(withOpenApi: false); @@ -404,7 +404,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public void OpenApi_Add_URL_MultipleTimes_OnlyOneReference() { var project = CreateBasicProject(withOpenApi: false); @@ -431,7 +431,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task OpenAPi_Add_URL_InvalidUrl() { var project = CreateBasicProject(withOpenApi: false); @@ -459,7 +459,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests Assert.False(File.Exists(jsonFile)); } - [Flaky("", FlakyOn.All)] + [QuarantinedTest] [Fact] public void OpenApi_Add_URL_ActualResponse() { diff --git a/src/Tools/dotnet-user-secrets/test/InitCommandTest.cs b/src/Tools/dotnet-user-secrets/test/InitCommandTest.cs index ba97d5711c..d299c208ca 100644 --- a/src/Tools/dotnet-user-secrets/test/InitCommandTest.cs +++ b/src/Tools/dotnet-user-secrets/test/InitCommandTest.cs @@ -57,7 +57,7 @@ namespace Microsoft.Extensions.SecretManager.Tools.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public void AddsEscapedSpecificSecretIdToProject() { const string SecretId = @"&"; diff --git a/src/Tools/dotnet-user-secrets/test/SecretManagerTests.cs b/src/Tools/dotnet-user-secrets/test/SecretManagerTests.cs index 6d79642a4c..c16a89197f 100644 --- a/src/Tools/dotnet-user-secrets/test/SecretManagerTests.cs +++ b/src/Tools/dotnet-user-secrets/test/SecretManagerTests.cs @@ -37,7 +37,7 @@ namespace Microsoft.Extensions.SecretManager.Tools.Tests [Theory] [InlineData(null)] [InlineData("")] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public void Error_MissingId(string id) { var project = Path.Combine(_fixture.CreateProject(id), "TestProject.csproj"); @@ -83,7 +83,7 @@ namespace Microsoft.Extensions.SecretManager.Tools.Tests [Theory] [InlineData(true)] [InlineData(false)] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public void SetSecrets(bool fromCurrentDirectory) { var secrets = new KeyValuePair[] @@ -149,19 +149,20 @@ namespace Microsoft.Extensions.SecretManager.Tools.Tests } [Fact] + [QuarantinedTest] public void SetSecret_Update_Existing_Secret() { var projectPath = _fixture.GetTempSecretProject(); var secretManager = CreateProgram(); - secretManager.RunInternal("set", "secret1", "value1", "-p", projectPath); + secretManager.RunInternal("set", "secret1", "value1", "-p", projectPath, "--verbose"); Assert.Contains("Successfully saved secret1 = value1 to the secret store.", _console.GetOutput()); - secretManager.RunInternal("set", "secret1", "value2", "-p", projectPath); + secretManager.RunInternal("set", "secret1", "value2", "-p", projectPath, "--verbose"); Assert.Contains("Successfully saved secret1 = value2 to the secret store.", _console.GetOutput()); _console.ClearOutput(); - secretManager.RunInternal("list", "-p", projectPath); + secretManager.RunInternal("list", "-p", projectPath, "--verbose"); Assert.Contains("secret1 = value2", _console.GetOutput()); } @@ -186,7 +187,7 @@ namespace Microsoft.Extensions.SecretManager.Tools.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public void Remove_Non_Existing_Secret() { var projectPath = _fixture.GetTempSecretProject(); @@ -212,7 +213,7 @@ namespace Microsoft.Extensions.SecretManager.Tools.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public void List_Flattens_Nested_Objects() { string secretId; @@ -262,15 +263,16 @@ namespace Microsoft.Extensions.SecretManager.Tools.Tests } [Fact] + [QuarantinedTest] public void List_Empty_Secrets_File() { var projectPath = _fixture.GetTempSecretProject(); var secretManager = CreateProgram(); - secretManager.RunInternal("list", "-p", projectPath); + secretManager.RunInternal("list", "-p", projectPath, "--verbose"); Assert.Contains(Resources.Error_No_Secrets_Found, _console.GetOutput()); } - [Flaky("", FlakyOn.All)] + [QuarantinedTest] [Theory] [InlineData(true)] [InlineData(false)] diff --git a/src/Tools/dotnet-watch/test/AppWithDepsTests.cs b/src/Tools/dotnet-watch/test/AppWithDepsTests.cs index 1ec8a59284..5954f540b5 100644 --- a/src/Tools/dotnet-watch/test/AppWithDepsTests.cs +++ b/src/Tools/dotnet-watch/test/AppWithDepsTests.cs @@ -20,7 +20,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task ChangeFileInDependency() { await _app.StartWatcherAsync(); diff --git a/src/Tools/dotnet-watch/test/DotNetWatcherTests.cs b/src/Tools/dotnet-watch/test/DotNetWatcherTests.cs index 3ef636b009..d07f4e25a4 100644 --- a/src/Tools/dotnet-watch/test/DotNetWatcherTests.cs +++ b/src/Tools/dotnet-watch/test/DotNetWatcherTests.cs @@ -23,7 +23,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task RunsWithDotnetWatchEnvVariable() { Assert.True(string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DOTNET_WATCH")), "DOTNET_WATCH cannot be set already when this test is running"); @@ -36,7 +36,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task RunsWithIterationEnvVariable() { await _app.StartWatcherAsync(); diff --git a/src/Tools/dotnet-watch/test/GlobbingAppTests.cs b/src/Tools/dotnet-watch/test/GlobbingAppTests.cs index 8862debc7f..9383b2d728 100644 --- a/src/Tools/dotnet-watch/test/GlobbingAppTests.cs +++ b/src/Tools/dotnet-watch/test/GlobbingAppTests.cs @@ -24,7 +24,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests [Theory] [InlineData(true)] [InlineData(false)] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task ChangeCompiledFile(bool usePollingWatcher) { _app.UsePollingWatcher = usePollingWatcher; @@ -43,7 +43,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task DeleteCompiledFile() { await _app.StartWatcherAsync(); @@ -60,7 +60,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task DeleteSourceFolder() { await _app.StartWatcherAsync(); @@ -77,7 +77,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task RenameCompiledFile() { await _app.StartWatcherAsync(); @@ -90,7 +90,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task ChangeExcludedFile() { await _app.StartWatcherAsync(); @@ -104,11 +104,10 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests } [Fact] - [Flaky("", FlakyOn.All)] public async Task ListsFiles() { await _app.PrepareAsync(); - _app.Start(new [] { "--list" }); + _app.Start(new[] { "--list" }); var cts = new CancellationTokenSource(); cts.CancelAfter(TimeSpan.FromSeconds(30)); var lines = await _app.Process.GetAllOutputLinesAsync(cts.Token); diff --git a/src/Tools/dotnet-watch/test/NoDepsAppTests.cs b/src/Tools/dotnet-watch/test/NoDepsAppTests.cs index 5b1cc36788..b7171d5ad2 100644 --- a/src/Tools/dotnet-watch/test/NoDepsAppTests.cs +++ b/src/Tools/dotnet-watch/test/NoDepsAppTests.cs @@ -24,7 +24,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task RestartProcessOnFileChange() { await _app.StartWatcherAsync(new[] { "--no-exit" }); @@ -43,7 +43,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task RestartProcessThatTerminatesAfterFileChange() { await _app.StartWatcherAsync(); diff --git a/src/Tools/dotnet-watch/test/ProgramTests.cs b/src/Tools/dotnet-watch/test/ProgramTests.cs index 3036356c16..40c2af5214 100644 --- a/src/Tools/dotnet-watch/test/ProgramTests.cs +++ b/src/Tools/dotnet-watch/test/ProgramTests.cs @@ -24,7 +24,6 @@ namespace Microsoft.DotNet.Watcher.Tools.Tests } [Fact] - [Flaky("", FlakyOn.All)] public async Task ConsoleCancelKey() { _tempDir