Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
xuning
/
sherpaonnx
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
JiayuXu
2024-12-03 17:22:12 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2024-12-03 17:22:12 +0800
Commit
0d6bf528446bbd8cca996cf6cdb1fa6c7790309c
0d6bf528
1 parent
dc3287f3
fix: support both old and new websockets request headers format (#1588)
Co-authored-by: xujiayu <xujiayu@kaihong.com>
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
10 行增加
和
2 行删除
python-api-examples/non_streaming_server.py
python-api-examples/streaming_server.py
python-api-examples/non_streaming_server.py
查看文件 @
0d6bf52
...
...
@@ -641,7 +641,11 @@ class NonStreamingServer:
path
:
str
,
request_headers
:
websockets
.
Headers
,
)
->
Optional
[
Tuple
[
http
.
HTTPStatus
,
websockets
.
Headers
,
bytes
]]:
if
"sec-websocket-key"
not
in
request_headers
:
if
"sec-websocket-key"
not
in
(
request_headers
.
headers
# For new request_headers
if
hasattr
(
request_headers
,
"headers"
)
else
request_headers
# For old request_headers
):
# This is a normal HTTP request
if
path
==
"/"
:
path
=
"/index.html"
...
...
python-api-examples/streaming_server.py
查看文件 @
0d6bf52
...
...
@@ -584,7 +584,11 @@ class StreamingServer(object):
path
:
str
,
request_headers
:
websockets
.
Headers
,
)
->
Optional
[
Tuple
[
http
.
HTTPStatus
,
websockets
.
Headers
,
bytes
]]:
if
"sec-websocket-key"
not
in
request_headers
:
if
"sec-websocket-key"
not
in
(
request_headers
.
headers
# For new request_headers
if
hasattr
(
request_headers
,
"headers"
)
else
request_headers
# For old request_headers
):
# This is a normal HTTP request
if
path
==
"/"
:
path
=
"/index.html"
...
...
请
注册
或
登录
后发表评论