diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000000..83509a9fd2 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,53 @@ +#area-azure: + +area-blazor: + - src/Components/**/* + +#area-commandlinetools: + +area-dataprotection: + - src/DataProtection/**/* + +#area-grpc: + +#area-healthchecks: + +area-hosting: + - src/Hosting/**/* + - src/SiteExtensions/**/* + +#area-httpclientfactory: + +area-identity: + - src/Identity/**/* + +area-infrastructure: + - global.json + - .azure/**/* + - .config/**/* + - eng/**/* + +area-installers: + - src/Installers/**/* + +area-middleware: + - src/Middleware/**/* + +area-mvc: + - src/ProjectTemplates/**/* + - src/Razor/**/* + - src/Mvc/**/* + - src/MusicStore/**/* + +#area-platform: + +area-security: + - src/Security/**/* + +area-servers: + - src/Servers/**/* + +area-signalr: + - src/SignalR/**/* + +#area-websockets: diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000000..dcafb97dc9 --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,11 @@ +name: "Pull Request Labeler" +on: +- pull_request + +jobs: + triage: + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v2 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/docs/ReferenceAssemblies.md b/docs/ReferenceAssemblies.md index 1ef20699e6..593682a29e 100644 --- a/docs/ReferenceAssemblies.md +++ b/docs/ReferenceAssemblies.md @@ -22,4 +22,4 @@ Set `false` in the implementation ( ### Regenerate reference assemblies for all projects -Run `.\eng\scripts\GenerateReferenceAssemblies.ps1` from repository root. +Run `.\eng\scripts\GenerateReferenceAssemblies.ps1` from repository root. Make sure you've run `.\restore.cmd` first. diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 8c09af2e3c..59a61d4631 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -9,9 +9,9 @@ --> - + https://github.com/aspnet/Blazor - 333321c929b8c9f3385d299c9df6f2c8a96e1822 + adc2dc6547bc542aa687c712e0e3c0e5de3500fe https://github.com/aspnet/AspNetCore-Tooling @@ -29,269 +29,269 @@ https://github.com/aspnet/AspNetCore-Tooling debe2d2e911020ffee5d6e95eb4dc6d0754bd8ef - + https://github.com/aspnet/EntityFrameworkCore - c1215453fb2d89acac314249c9f0749acef4c2f4 + 2da52082db1fb33f785822c560f2373e691bab0c - + https://github.com/aspnet/EntityFrameworkCore - c1215453fb2d89acac314249c9f0749acef4c2f4 + 2da52082db1fb33f785822c560f2373e691bab0c - + https://github.com/aspnet/EntityFrameworkCore - c1215453fb2d89acac314249c9f0749acef4c2f4 + 2da52082db1fb33f785822c560f2373e691bab0c - + https://github.com/aspnet/EntityFrameworkCore - c1215453fb2d89acac314249c9f0749acef4c2f4 + 2da52082db1fb33f785822c560f2373e691bab0c - + https://github.com/aspnet/EntityFrameworkCore - c1215453fb2d89acac314249c9f0749acef4c2f4 + 2da52082db1fb33f785822c560f2373e691bab0c - + https://github.com/aspnet/EntityFrameworkCore - c1215453fb2d89acac314249c9f0749acef4c2f4 + 2da52082db1fb33f785822c560f2373e691bab0c - + https://github.com/aspnet/EntityFrameworkCore - c1215453fb2d89acac314249c9f0749acef4c2f4 + 2da52082db1fb33f785822c560f2373e691bab0c - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 https://github.com/dotnet/corefx @@ -381,25 +381,25 @@ https://github.com/dotnet/corefx a434a52ae3f1175bc1cad8b1a02b0921ef3b1f55 - + https://github.com/dotnet/core-setup - 3fccad76fc65967dc194983284c3a43de37e95a0 + 4ace84dbf94128b4825c76cdd09b46dba7473478 - + https://github.com/dotnet/core-setup - 3fccad76fc65967dc194983284c3a43de37e95a0 + 4ace84dbf94128b4825c76cdd09b46dba7473478 - + https://github.com/dotnet/core-setup - 3fccad76fc65967dc194983284c3a43de37e95a0 + 4ace84dbf94128b4825c76cdd09b46dba7473478 - + https://github.com/dotnet/core-setup - 3fccad76fc65967dc194983284c3a43de37e95a0 + 4ace84dbf94128b4825c76cdd09b46dba7473478 @@ -408,9 +408,9 @@ https://github.com/dotnet/corefx a434a52ae3f1175bc1cad8b1a02b0921ef3b1f55 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 https://github.com/dotnet/arcade @@ -424,9 +424,9 @@ https://github.com/dotnet/arcade f70d1fca3d5d4045be75694006f1bee0e0aec572 - + https://github.com/aspnet/Extensions - 1dfe8bc2af511822677789c29a0c800f7cca1d7b + 5fb4eb52033b15dea5a4165fb7ce15f6bee83cf0 https://github.com/dotnet/roslyn diff --git a/eng/Versions.props b/eng/Versions.props index 162cf96572..b010036154 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -66,10 +66,10 @@ 3.4.0-beta1-19456-03 - 5.0.0-alpha1.19506.5 - 5.0.0-alpha1.19506.5 - 5.0.0-alpha1.19506.5 - 2.1.0-alpha1.19506.5 + 5.0.0-alpha1.19514.1 + 5.0.0-alpha1.19514.1 + 5.0.0-alpha1.19514.1 + 2.1.0-alpha1.19514.1 1.2.0-alpha1.19504.7 5.0.0-alpha1.19504.7 @@ -96,77 +96,77 @@ 5.0.0-alpha1.19504.7 - 5.0.0-alpha1.19501.1 + 5.0.0-alpha1.19514.2 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 - 5.0.0-alpha1.19512.1 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 + 5.0.0-alpha1.19514.8 - 5.0.0-alpha1.19514.3 - 5.0.0-alpha1.19514.3 - 5.0.0-alpha1.19514.3 - 5.0.0-alpha1.19514.3 - 5.0.0-alpha1.19514.3 - 5.0.0-alpha1.19514.3 - 5.0.0-alpha1.19514.3 + 5.0.0-alpha1.19515.8 + 5.0.0-alpha1.19515.8 + 5.0.0-alpha1.19515.8 + 5.0.0-alpha1.19515.8 + 5.0.0-alpha1.19515.8 + 5.0.0-alpha1.19515.8 + 5.0.0-alpha1.19515.8 5.0.0-alpha1.19513.1 5.0.0-alpha1.19513.1 diff --git a/src/Http/Http.Extensions/src/RequestHeaders.cs b/src/Http/Http.Extensions/src/RequestHeaders.cs index 12246922d4..94fa8149b9 100644 --- a/src/Http/Http.Extensions/src/RequestHeaders.cs +++ b/src/Http/Http.Extensions/src/RequestHeaders.cs @@ -279,11 +279,27 @@ namespace Microsoft.AspNetCore.Http.Headers } } + /// + /// Gets the value of header with . + /// + /// must contain a TryParse method with the signature public static bool TryParse(string, out T). + /// The type of the header. + /// The given type must have a static TryParse method. + /// The name of the header to retrieve. + /// The value of the header. public T Get(string name) { return Headers.Get(name); } + /// + /// Gets the values of header with . + /// + /// must contain a TryParseList method with the signature public static bool TryParseList(IList<string>, out IList<T>). + /// The type of the header. + /// The given type must have a static TryParseList method. + /// The name of the header to retrieve. + /// List of values of the header. public IList GetList(string name) { return Headers.GetList(name); diff --git a/src/Http/Http.Extensions/src/ResponseHeaders.cs b/src/Http/Http.Extensions/src/ResponseHeaders.cs index 87e3c0318c..2feff2fe3c 100644 --- a/src/Http/Http.Extensions/src/ResponseHeaders.cs +++ b/src/Http/Http.Extensions/src/ResponseHeaders.cs @@ -158,11 +158,27 @@ namespace Microsoft.AspNetCore.Http.Headers } } + /// + /// Gets the value of header with . + /// + /// must contain a TryParse method with the signature public static bool TryParse(string, out T). + /// The type of the header. + /// The given type must have a static TryParse method. + /// The name of the header to retrieve. + /// The value of the header. public T Get(string name) { return Headers.Get(name); } + /// + /// Gets the values of header with . + /// + /// must contain a TryParseList method with the signature public static bool TryParseList(IList<string>, out IList<T>). + /// The type of the header. + /// The given type must have a static TryParseList method. + /// The name of the header to retrieve. + /// List of values of the header. public IList GetList(string name) { return Headers.GetList(name); @@ -208,4 +224,4 @@ namespace Microsoft.AspNetCore.Http.Headers Headers.AppendList(name, values); } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.DataAnnotations/src/DataAnnotationsMetadataProvider.cs b/src/Mvc/Mvc.DataAnnotations/src/DataAnnotationsMetadataProvider.cs index 0e975e697f..956f585a75 100644 --- a/src/Mvc/Mvc.DataAnnotations/src/DataAnnotationsMetadataProvider.cs +++ b/src/Mvc/Mvc.DataAnnotations/src/DataAnnotationsMetadataProvider.cs @@ -481,7 +481,7 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations // See: https://github.com/dotnet/roslyn/blob/master/docs/features/nullable-reference-types.md#annotations if (nullableAttribute.GetType().GetField(NullableFlagsFieldName) is FieldInfo field && field.GetValue(nullableAttribute) is byte[] flags && - flags.Length >= 0 && + flags.Length > 0 && flags[0] == 1) // First element is the property/parameter type. { isNullable = true; diff --git a/src/Mvc/Mvc.ViewFeatures/src/RazorComponents/StaticComponentRenderer.cs b/src/Mvc/Mvc.ViewFeatures/src/RazorComponents/StaticComponentRenderer.cs index 89304873c1..411e6014a8 100644 --- a/src/Mvc/Mvc.ViewFeatures/src/RazorComponents/StaticComponentRenderer.cs +++ b/src/Mvc/Mvc.ViewFeatures/src/RazorComponents/StaticComponentRenderer.cs @@ -52,7 +52,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures // all components have rendered. throw new InvalidOperationException("A navigation command was attempted during prerendering after the server already started sending the response. " + "Navigation commands can not be issued during server-side prerendering after the response from the server has started. Applications must buffer the" + - "reponse and avoid using features like FlushAsync() before all components on the page have been rendered to prevent failed navigation commands.", navigationException); + "response and avoid using features like FlushAsync() before all components on the page have been rendered to prevent failed navigation commands.", navigationException); } httpContext.Response.Redirect(navigationException.Location); diff --git a/src/Mvc/Mvc.ViewFeatures/test/RazorComponents/ComponentRendererTest.cs b/src/Mvc/Mvc.ViewFeatures/test/RazorComponents/ComponentRendererTest.cs index 1e89472473..f9e403ca2f 100644 --- a/src/Mvc/Mvc.ViewFeatures/test/RazorComponents/ComponentRendererTest.cs +++ b/src/Mvc/Mvc.ViewFeatures/test/RazorComponents/ComponentRendererTest.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// 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; @@ -473,8 +473,8 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures })); Assert.Equal("A navigation command was attempted during prerendering after the server already started sending the response. " + - "Navigation commands can not be issued during server-side prerendering after the response from the server has started. Applications must buffer the" + - "reponse and avoid using features like FlushAsync() before all components on the page have been rendered to prevent failed navigation commands.", + "Navigation commands can not be issued during server-side prerendering after the response from the server has started. Applications must buffer the" + + "response and avoid using features like FlushAsync() before all components on the page have been rendered to prevent failed navigation commands.", exception.Message); } diff --git a/src/SignalR/common/SignalR.Common/test/Internal/Protocol/JsonHubProtocolTestsBase.cs b/src/SignalR/common/SignalR.Common/test/Internal/Protocol/JsonHubProtocolTestsBase.cs index 1570b54462..855281aecd 100644 --- a/src/SignalR/common/SignalR.Common/test/Internal/Protocol/JsonHubProtocolTestsBase.cs +++ b/src/SignalR/common/SignalR.Common/test/Internal/Protocol/JsonHubProtocolTestsBase.cs @@ -312,6 +312,50 @@ namespace Microsoft.AspNetCore.SignalR.Common.Tests.Internal.Protocol }, streamItemMessage.Item); } + public static IDictionary MessageSizeData => new[] + { + new MessageSizeTestData("InvocationMessage_WithoutInvocationId", new InvocationMessage("Target", new object[] { 1 }), 45), + new MessageSizeTestData("InvocationMessage_WithInvocationId", new InvocationMessage("1", "Target", new object[] { 1 }), 64), + new MessageSizeTestData("InvocationMessage_WithInvocationIdAndStreamId", new InvocationMessage("1", "Target", new object[] { 1 }, new string[] { "2" }), 82), + + new MessageSizeTestData("CloseMessage_Empty", CloseMessage.Empty, 11), + new MessageSizeTestData("CloseMessage_WithError", new CloseMessage("error"), 27), + + new MessageSizeTestData("StreamItemMessage_WithNullItem", new StreamItemMessage("1", null), 42), + new MessageSizeTestData("StreamItemMessage_WithItem", new StreamItemMessage("1", 1), 39), + + new MessageSizeTestData("CompletionMessage_Empty", CompletionMessage.Empty("1"), 30), + new MessageSizeTestData("CompletionMessage_WithResult", CompletionMessage.WithResult("1", 1), 41), + new MessageSizeTestData("CompletionMessage_WithError", CompletionMessage.WithError("1", "error"), 46), + + new MessageSizeTestData("StreamInvocationMessage", new StreamInvocationMessage("1", "target", Array.Empty()), 63), + new MessageSizeTestData("StreamInvocationMessage_WithStreamId", new StreamInvocationMessage("1", "target", Array.Empty(), new [] { "2" }), 81), + + new MessageSizeTestData("CancelInvocationMessage", new CancelInvocationMessage("1"), 30), + + new MessageSizeTestData("PingMessage", PingMessage.Instance, 11), + }.ToDictionary(t => t.Name); + + public static IEnumerable MessageSizeDataNames => MessageSizeData.Keys.Select(name => new object[] { name }); + + [Theory] + [MemberData(nameof(MessageSizeDataNames))] + public void VerifyMessageSize(string testDataName) + { + var testData = MessageSizeData[testDataName]; + + var writer = MemoryBufferWriter.Get(); + try + { + JsonHubProtocol.WriteMessage(testData.Message, writer); + Assert.Equal(testData.Size, writer.Length); + } + finally + { + MemoryBufferWriter.Return(writer); + } + } + public static string Frame(string input) { var data = Encoding.UTF8.GetBytes(input); @@ -345,5 +389,21 @@ namespace Microsoft.AspNetCore.SignalR.Common.Tests.Internal.Protocol public override string ToString() => Name; } + + public class MessageSizeTestData + { + public string Name { get; } + public HubMessage Message { get; } + public int Size { get; } + + public MessageSizeTestData(string name, HubMessage message, int size) + { + Name = name; + Message = message; + Size = size; + } + + public override string ToString() => Name; + } } } diff --git a/src/SignalR/common/SignalR.Common/test/Internal/Protocol/MessagePackHubProtocolTests.cs b/src/SignalR/common/SignalR.Common/test/Internal/Protocol/MessagePackHubProtocolTests.cs index 8134f8e9bf..256037b17e 100644 --- a/src/SignalR/common/SignalR.Common/test/Internal/Protocol/MessagePackHubProtocolTests.cs +++ b/src/SignalR/common/SignalR.Common/test/Internal/Protocol/MessagePackHubProtocolTests.cs @@ -195,5 +195,55 @@ namespace Microsoft.AspNetCore.SignalR.Common.Tests.Internal.Protocol TestWriteMessages(testData); } + + public static IDictionary MessageSizeData => new[] + { + new MessageSizeTestData("InvocationMessage_WithoutInvocationId", new InvocationMessage("Target", new object[] { 1 }), 15), + new MessageSizeTestData("InvocationMessage_WithInvocationId", new InvocationMessage("1", "Target", new object[] { 1 }), 16), + new MessageSizeTestData("InvocationMessage_WithInvocationIdAndStreamId", new InvocationMessage("1", "Target", new object[] { 1 }, new string[] { "2" }), 18), + + new MessageSizeTestData("CloseMessage_Empty", CloseMessage.Empty, 4), + new MessageSizeTestData("CloseMessage_WithError", new CloseMessage("error"), 9), + + new MessageSizeTestData("StreamItemMessage_WithNullItem", new StreamItemMessage("1", null), 7), + new MessageSizeTestData("StreamItemMessage_WithItem", new StreamItemMessage("1", 1), 7), + + new MessageSizeTestData("CompletionMessage_Empty", CompletionMessage.Empty("1"), 7), + new MessageSizeTestData("CompletionMessage_WithResult", CompletionMessage.WithResult("1", 1), 8), + new MessageSizeTestData("CompletionMessage_WithError", CompletionMessage.WithError("1", "error"), 13), + + new MessageSizeTestData("StreamInvocationMessage", new StreamInvocationMessage("1", "target", Array.Empty()), 15), + new MessageSizeTestData("StreamInvocationMessage_WithStreamId", new StreamInvocationMessage("1", "target", Array.Empty(), new [] { "2" }), 17), + + new MessageSizeTestData("CancelInvocationMessage", new CancelInvocationMessage("1"), 6), + + new MessageSizeTestData("PingMessage", PingMessage.Instance, 3), + }.ToDictionary(t => t.Name); + + public static IEnumerable MessageSizeDataNames => MessageSizeData.Keys.Select(name => new object[] { name }); + + [Theory] + [MemberData(nameof(MessageSizeDataNames))] + public void VerifyMessageSize(string testDataName) + { + var testData = MessageSizeData[testDataName]; + Assert.Equal(testData.Size, Write(testData.Message).Length); + } + + public class MessageSizeTestData + { + public string Name { get; } + public HubMessage Message { get; } + public int Size { get; } + + public MessageSizeTestData(string name, HubMessage message, int size) + { + Name = name; + Message = message; + Size = size; + } + + public override string ToString() => Name; + } } }