mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 19:56:51 +08:00
Fix: HTTP server should close when Connection
is close
This commit is contained in:
parent
1860de9362
commit
c21bd48213
|
@ -54,7 +54,12 @@ func handleHTTP(ctx *context.HTTPContext, outbound net.Conn) {
|
|||
goto handleResponse
|
||||
}
|
||||
|
||||
if keepAlive || resp.ContentLength >= 0 {
|
||||
// close conn when header `Connection` is `close`
|
||||
if resp.Header.Get("Connection") == "close" {
|
||||
keepAlive = false
|
||||
}
|
||||
|
||||
if keepAlive {
|
||||
resp.Header.Set("Proxy-Connection", "keep-alive")
|
||||
resp.Header.Set("Connection", "keep-alive")
|
||||
resp.Header.Set("Keep-Alive", "timeout=4")
|
||||
|
|
Loading…
Reference in New Issue
Block a user