mirror of
https://github.com/cmz0228/hysteria-dev.git
synced 2025-06-08 13:29:53 +00:00
fix(client/http): ffmpeg not works with proxy
Go's resp.Write() adds a "Content-Length: 0" header and it seems that ffmpeg doesn't like this and immediately closes the proxy connection. close: #1109
This commit is contained in:
parent
492145c124
commit
e1ac7c88ab
@ -278,6 +278,9 @@ func sendSimpleResponse(conn net.Conn, req *http.Request, statusCode int) error
|
|||||||
ProtoMinor: req.ProtoMinor,
|
ProtoMinor: req.ProtoMinor,
|
||||||
Header: http.Header{},
|
Header: http.Header{},
|
||||||
}
|
}
|
||||||
|
// Remove the "Content-Length: 0" header, some clients (e.g. ffmpeg) may not like it.
|
||||||
|
// NOTE: This will also cause go/http to add a "Connection: close" header, but seems to be fine.
|
||||||
|
resp.ContentLength = -1
|
||||||
return resp.Write(conn)
|
return resp.Write(conn)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user