Skip to content

Commit

Permalink
[OneBot] Correctly handle POST urlencode content being empty (#691)
Browse files Browse the repository at this point in the history
  • Loading branch information
ishkong authored Nov 23, 2024
1 parent 606f376 commit 30c1a0f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Lagrange.OneBot/Core/Network/Service/HttpService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ private async Task HandleRequestAsync(HttpListenerContext context, CancellationT
var body = await reader.ReadToEndAsync(token);
Log.LogReceived(_logger, identifier, body);
var @params = body.Split('&')
.Where(pair => !string.IsNullOrEmpty(pair))
.Select(pair => pair.Split('=', 2))
.ToDictionary(pair => pair[0], pair => Uri.UnescapeDataString(pair[1]));
payload = JsonSerializer.Serialize(new { action, @params });
Expand Down

0 comments on commit 30c1a0f

Please sign in to comment.