Skip to content

Commit 4711627

Browse files
committed
Merge branch 'mbuck/passkeys' of https://github.com/dotnet/aspnetcore into mbuck/passkeys
2 parents 7f63102 + d2cb5f5 commit 4711627

File tree

114 files changed

+1731
-906
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+1731
-906
lines changed

eng/Version.Details.xml

Lines changed: 182 additions & 182 deletions
Large diffs are not rendered by default.

eng/Versions.props

Lines changed: 87 additions & 87 deletions
Large diffs are not rendered by default.

global.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"sdk": {
3-
"version": "10.0.100-preview.6.25272.112"
3+
"version": "10.0.100-preview.6.25302.104"
44
},
55
"tools": {
6-
"dotnet": "10.0.100-preview.6.25272.112",
6+
"dotnet": "10.0.100-preview.6.25302.104",
77
"runtimes": {
88
"dotnet/x86": [
99
"$(MicrosoftInternalRuntimeAspNetCoreTransportVersion)"
@@ -27,9 +27,9 @@
2727
"jdk": "latest"
2828
},
2929
"msbuild-sdks": {
30-
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25303.102",
31-
"Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25303.102",
32-
"Microsoft.DotNet.SharedFramework.Sdk": "10.0.0-beta.25303.102",
30+
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25304.106",
31+
"Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25304.106",
32+
"Microsoft.DotNet.SharedFramework.Sdk": "10.0.0-beta.25304.106",
3333
"Microsoft.Build.NoTargets": "3.7.0",
3434
"Microsoft.Build.Traversal": "3.4.0"
3535
}

src/Components/Endpoints/src/RazorComponentEndpointInvoker.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,10 @@ await _renderer.InitializeStandardComponentServicesAsync(
175175
private async Task<RequestValidationState> ValidateRequestAsync(HttpContext context, IAntiforgery? antiforgery)
176176
{
177177
var processPost = HttpMethods.IsPost(context.Request.Method) &&
178-
// Disable POST functionality during exception handling and reexecution.
178+
// Disable POST functionality during exception handling.
179179
// The exception handler middleware will not update the request method, and we don't
180180
// want to run the form handling logic against the error page.
181-
context.Features.Get<IExceptionHandlerFeature>() == null &&
182-
context.Features.Get<IStatusCodePagesFeature>() == null;
181+
context.Features.Get<IExceptionHandlerFeature>() == null;
183182

184183
if (processPost)
185184
{

src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/FormWithParentBindingContextTest.cs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,20 @@ public void CanDispatchToTheDefaultForm(bool suppressEnhancedNavigation)
4949
DispatchToFormCore(dispatchToForm);
5050
}
5151

52+
[Theory]
53+
[InlineData(true)]
54+
[InlineData(false)]
55+
public void CanDispatchToTheDefaultFormWithReExecutionMiddleware(bool suppressEnhancedNavigation)
56+
{
57+
var dispatchToForm = new DispatchToForm(this)
58+
{
59+
Url = "reexecution/forms/default-form",
60+
FormCssSelector = "form",
61+
SuppressEnhancedNavigation = suppressEnhancedNavigation,
62+
};
63+
DispatchToFormCore(dispatchToForm);
64+
}
65+
5266
[Fact]
5367
public void PlainFormIsNotEnhancedByDefault()
5468
{
@@ -891,6 +905,21 @@ public async Task CanModifyTheHttpResponseDuringEventHandling()
891905
Assert.Equal("ModifyHttpContext", cookie.Value);
892906
}
893907

908+
[Theory]
909+
[InlineData(true)]
910+
[InlineData(false)]
911+
public void FormNoAntiforgeryReturnBadRequestWithReExecutionMiddleware(bool suppressEnhancedNavigation)
912+
{
913+
var dispatchToForm = new DispatchToForm(this)
914+
{
915+
Url = "reexecution/forms/no-antiforgery",
916+
FormCssSelector = "form",
917+
ShouldCauseBadRequest = true,
918+
SuppressEnhancedNavigation = suppressEnhancedNavigation,
919+
};
920+
DispatchToFormCore(dispatchToForm);
921+
}
922+
894923
[Theory]
895924
[InlineData(true)]
896925
[InlineData(false)]
@@ -973,6 +1002,21 @@ public void FormNoHandlerReturnBadRequest(bool suppressEnhancedNavigation)
9731002
DispatchToFormCore(dispatchToForm);
9741003
}
9751004

1005+
[Theory]
1006+
[InlineData(true)]
1007+
[InlineData(false)]
1008+
public void FormNoHandlerReturnBadRequestWithReExecutionMiddleware(bool suppressEnhancedNavigation)
1009+
{
1010+
var dispatchToForm = new DispatchToForm(this)
1011+
{
1012+
Url = "reexecution/forms/no-handler",
1013+
FormCssSelector = "form",
1014+
ShouldCauseBadRequest = true,
1015+
SuppressEnhancedNavigation = suppressEnhancedNavigation,
1016+
};
1017+
DispatchToFormCore(dispatchToForm);
1018+
}
1019+
9761020
[Theory]
9771021
[InlineData(true)]
9781022
[InlineData(false)]

src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/Forms/DefaultForm.razor

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@page "/forms/default-form"
2+
@page "/reexecution/forms/default-form"
23
@using Microsoft.AspNetCore.Components.Forms
34

45
<h2>Default form</h2>

src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/Forms/FormNoAntiforgery.razor

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@page "/forms/no-antiforgery"
2+
@page "/reexecution/forms/no-antiforgery"
23
@using Microsoft.AspNetCore.Components.Forms
34

45
<h2>Default form</h2>

src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/Forms/FormNoHandler.razor

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@page "/forms/no-handler"
2+
@page "/reexecution/forms/no-handler"
23
@using Microsoft.AspNetCore.Components.Forms
34

45
<h2>Form with no handler</h2>

src/Mvc/Mvc.Testing/src/WebApplicationFactory.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public virtual IServiceProvider Services
103103
StartServer();
104104
if (_useKestrel)
105105
{
106-
return _webHost!.Services;
106+
return _webHost?.Services ?? _host!.Services;
107107
}
108108

109109
return _host?.Services ?? _server!.Host.Services;
@@ -263,8 +263,8 @@ public void StartServer()
263263
{
264264
var deferredHostBuilder = new DeferredHostBuilder();
265265
deferredHostBuilder.UseEnvironment(Environments.Development);
266-
// There's no helper for UseApplicationName, but we need to
267-
// set the application name to the target entry point
266+
// There's no helper for UseApplicationName, but we need to
267+
// set the application name to the target entry point
268268
// assembly name.
269269
deferredHostBuilder.ConfigureHostConfiguration(config =>
270270
{
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using Microsoft.AspNetCore.Mvc.Testing;
5+
6+
namespace Microsoft.AspNetCore.Mvc.FunctionalTests;
7+
8+
public class KestrelBasedWebApplicationFactoryForMinimal : WebApplicationFactory<SimpleWebSiteWithWebApplicationBuilder.Program>
9+
{
10+
public KestrelBasedWebApplicationFactoryForMinimal() : base()
11+
{
12+
// Use dynamically assigned port to avoid test conflicts in CI.
13+
this.UseKestrel(0);
14+
}
15+
}

0 commit comments

Comments
 (0)