Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
runtime
提交
8fb75deb
R
runtime
项目概览
dotNET Platform
/
runtime
11 个月 前同步成功
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
runtime
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
8fb75deb
编写于
6月 21, 2022
作者:
M
Marie Píchová
提交者:
GitHub
6月 21, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed :scheme header for H/2 with PlaintextStreamFilter (#71057)
上级
925e26ed
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
3 deletion
+8
-3
src/libraries/Common/tests/System/Net/Http/Http2LoopbackConnection.cs
...s/Common/tests/System/Net/Http/Http2LoopbackConnection.cs
+1
-1
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs
...src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs
+1
-1
src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs
....Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs
+6
-1
未找到文件。
src/libraries/Common/tests/System/Net/Http/Http2LoopbackConnection.cs
浏览文件 @
8fb75deb
...
@@ -103,7 +103,7 @@ private async Task ReadPrefixAsync()
...
@@ -103,7 +103,7 @@ private async Task ReadPrefixAsync()
await
_connectionStream
.
WriteAsync
(
"HTTP/2.0 400 Bad Request\r\n\r\n"
u8
.
ToArray
());
await
_connectionStream
.
WriteAsync
(
"HTTP/2.0 400 Bad Request\r\n\r\n"
u8
.
ToArray
());
_connectionSocket
.
Shutdown
(
SocketShutdown
.
Send
);
_connectionSocket
.
Shutdown
(
SocketShutdown
.
Send
);
// If WinHTTP doesn't support streaming a request without a length then it will fallback
// If WinHTTP doesn't support streaming a request without a length then it will fallback
// to HTTP/1.1. Throwing an exception to detect this case in WinHttpHandler tests.
// to HTTP/1.1. Throwing an exception to detect this case in WinHttpHandler tests.
throw
new
Exception
(
"HTTP/1.1 request sent to HTTP/2 connection."
);
throw
new
Exception
(
"HTTP/1.1 request sent to HTTP/2 connection."
);
}
}
}
}
...
...
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs
浏览文件 @
8fb75deb
...
@@ -1424,7 +1424,7 @@ private void WriteHeaders(HttpRequestMessage request, ref ArrayBuffer headerBuff
...
@@ -1424,7 +1424,7 @@ private void WriteHeaders(HttpRequestMessage request, ref ArrayBuffer headerBuff
WriteIndexedHeader
(
H2StaticTable
.
MethodGet
,
normalizedMethod
.
Method
,
ref
headerBuffer
);
WriteIndexedHeader
(
H2StaticTable
.
MethodGet
,
normalizedMethod
.
Method
,
ref
headerBuffer
);
}
}
WriteIndexedHeader
(
_
stream
is
SslStream
?
H2StaticTable
.
SchemeHttps
:
H2StaticTable
.
SchemeHttp
,
ref
headerBuffer
);
WriteIndexedHeader
(
_
pool
.
IsSecure
?
H2StaticTable
.
SchemeHttps
:
H2StaticTable
.
SchemeHttp
,
ref
headerBuffer
);
if
(
request
.
HasHeaders
&&
request
.
Headers
.
Host
!=
null
)
if
(
request
.
HasHeaders
&&
request
.
Headers
.
Host
!=
null
)
{
{
...
...
src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs
浏览文件 @
8fb75deb
...
@@ -3193,7 +3193,12 @@ public async Task PlaintextStreamFilter_SimpleDelegatingStream_Success(bool useS
...
@@ -3193,7 +3193,12 @@ public async Task PlaintextStreamFilter_SimpleDelegatingStream_Success(bool useS
},
},
async
server
=>
async
server
=>
{
{
await
server
.
AcceptConnectionSendResponseAndCloseAsync
(
content
:
"foo"
);
HttpRequestData
request
=
await
server
.
AcceptConnectionSendResponseAndCloseAsync
(
content
:
"foo"
);
if
(
request
.
Version
==
HttpVersion20
.
Value
)
{
HttpHeaderData
schemeHeader
=
Assert
.
Single
(
request
.
Headers
,
headerData
=>
headerData
.
Name
==
":scheme"
);
Assert
.
Equal
(
useSsl
?
"https"
:
"http"
,
schemeHeader
.
Value
);
}
},
options
:
options
);
},
options
:
options
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录