We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
HttpServerConfig
qq
问题
使用HttpServerConfig(即Webhook)配置时,若MAH传入的请求来自未在Ariadne中配置的QQ号,下列代码会触发:
Ariadne/src/graia/ariadne/connection/http.py
Lines 35 to 36 in 8e47d99
这将向其调用者返回None。而其调用者显然是不支持None的,抛出TypeError异常,进而导致返回500:
None
TypeError
https://github.com/GraiaProject/Amnesia/blob/v0.7.1/src/graia/amnesia/builtins/aiohttp.py#L439-L448
如何复现
使用HttpServerConfig配置启动Ariadne,向其监听的端口发送任意请求。当请求头qq与Ariadne配置不同时,可以注意到返回500错误,且控制台提示异常ValueError: unsupported response type <class 'NoneType'>。
ValueError: unsupported response type <class 'NoneType'>
预期行为
指定在此情况下的错误码。鉴于MAH Webhook Adapter文档并未指定在此种情况下应当返回的错误码,建议使用MAH API文档中提及的400错误,即替换return为return "Bad Request", {"status": 400}。
return
return "Bad Request", {"status": 400}
使用环境:
同#229。
日志/截图
The text was updated successfully, but these errors were encountered:
7fcab08
No branches or pull requests
问题
使用
HttpServerConfig
(即Webhook)配置时,若MAH传入的请求来自未在Ariadne中配置的QQ号,下列代码会触发:Ariadne/src/graia/ariadne/connection/http.py
Lines 35 to 36 in 8e47d99
这将向其调用者返回
None
。而其调用者显然是不支持None
的,抛出TypeError
异常,进而导致返回500:https://github.com/GraiaProject/Amnesia/blob/v0.7.1/src/graia/amnesia/builtins/aiohttp.py#L439-L448
如何复现
使用
HttpServerConfig
配置启动Ariadne,向其监听的端口发送任意请求。当请求头qq
与Ariadne配置不同时,可以注意到返回500错误,且控制台提示异常ValueError: unsupported response type <class 'NoneType'>
。预期行为
指定在此情况下的错误码。鉴于MAH Webhook Adapter文档并未指定在此种情况下应当返回的错误码,建议使用MAH API文档中提及的400错误,即替换
return
为return "Bad Request", {"status": 400}
。使用环境:
同#229。
日志/截图
The text was updated successfully, but these errors were encountered: