Skip to content
代码片段 群组 项目
提交 5d5f2388 编辑于 作者: Brennan's avatar Brennan 提交者: Will Godbe
浏览文件

Fix browser cookie tests to only run with HTTPS (#39665)

上级 249c9b19
No related branches found
No related tags found
无相关合并请求
......@@ -4,21 +4,11 @@
using System.Buffers;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Connections;
using Microsoft.AspNetCore.Http.Connections;
namespace FunctionalTests
{
public class EchoConnectionHandler : ConnectionHandler
{
public override async 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();
......
......@@ -185,6 +185,8 @@ describe("connection", () => {
await connection.start(TransferFormat.Text);
await connection.stop();
await closePromise;
});
}
......
......@@ -288,7 +288,7 @@ export function getErrorString(e: any): string {
}
/** @private */
export function getGlobalThis() {
export function getGlobalThis(): unknown {
// globalThis is semi-new and not available in Node until v12
if (typeof globalThis !== "undefined") {
return globalThis;
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册