Skip to content

Commit

Permalink
[OneBot] Adjusting HTTP code to OneBot standards
Browse files Browse the repository at this point in the history
https://github.com/botuniverse/onebot-11/blob/d4456ee706f9ada9c2dfde56a2bcfc69752600e4/communication/http.md?plain=1#L41
所有的POST content-type不支持都应该返回406,所以哪怕遇到lgr无法处理的,也应该返回406
  • Loading branch information
ishkong authored Nov 23, 2024
1 parent 30c1a0f commit 4b50dba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lagrange.OneBot/Core/Network/Service/HttpService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private async Task HandleRequestAsync(HttpListenerContext context, CancellationT
if (!MediaTypeHeaderValue.TryParse(request.ContentType, out var mediaType))
{
Log.LogCannotParseMediaType(_logger, request.ContentType ?? string.Empty);
response.StatusCode = (int)HttpStatusCode.UnsupportedMediaType;
response.StatusCode = (int)HttpStatusCode.NotAcceptable;
response.Close();
return;
}
Expand Down

0 comments on commit 4b50dba

Please sign in to comment.