fix redirect hanging

This commit is contained in:
uwaa 2024-10-27 23:49:33 +00:00
parent 2a62fb2c7b
commit e042d64e5e

View file

@ -147,7 +147,8 @@ public sealed class HttpServer
throw;
}
if (req.Headers.TryGetValue("connection", out string? connectionValue) && connectionValue == "close")
if ((response != null && response.StatusCode is >= 300 and < 400) ||
req.Headers.TryGetValue("connection", out string? connectionValue) && connectionValue == "close")
{
client.Close();
break;