fix redirect hanging
This commit is contained in:
parent
2a62fb2c7b
commit
e042d64e5e
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue