Skip to content

[Backport] Fix browser cookie tests to only run with HTTPS #39680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Security/Authentication/test/CertificateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public async Task VerifyClientCertWithUntrustedRootAndTrustedChainEndsUpInForbid
Assert.Equal(HttpStatusCode.Forbidden, response.StatusCode);
}

[Fact]
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/39669")]
public async Task VerifyValidClientCertWithTrustedChainAuthenticates()
{
using var host = await CreateHost(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,13 @@
using System.Buffers;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Connections;
using Microsoft.AspNetCore.Http.Connections;

namespace FunctionalTests
{
public class EchoConnectionHandler : ConnectionHandler
{
public async override Task OnConnectedAsync(ConnectionContext connection)
{
var context = connection.GetHttpContext();
// The 'withCredentials' tests wont send a cookie for cross-site requests
if (!context.WebSockets.IsWebSocketRequest && !context.Request.Cookies.ContainsKey("testCookie"))
{
return;
}

while (true)
{
var result = await connection.Transport.Input.ReadAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ describe("connection", () => {
withCredentials: false,
});

connection.onreceive = (data: any) => {
fail(new Error(`Unexpected messaged received '${data}'.`));
connection.onreceive = (_: any) => {
connection.stop();
};

// @ts-ignore: We don't use the error parameter intentionally.
Expand Down
Loading