Close streams on request completion

This commit is contained in:
DataHoarder 2022-06-06 23:01:41 +02:00
parent 10187307da
commit 475b799818
Signed by: DataHoarder
SSH key fingerprint: SHA256:OLTRf6Fl87G52SiR7sWLGNzlJt4WOX+tfI2yxo0z7xk
2 changed files with 2 additions and 0 deletions

View file

@ -82,6 +82,7 @@ func (c *FastHTTPContext) SetResponseHeader(name string, value string) {
}
func (c *FastHTTPContext) ServeStream(stream Stream) {
defer stream.Close()
const rangePrefix = "bytes="
if stream == nil {

View file

@ -83,6 +83,7 @@ func (c *NetHTTPContext) SetResponseHeader(name string, value string) {
}
func (c *NetHTTPContext) ServeStream(stream Stream) {
defer stream.Close()
const rangePrefix = "bytes="
if stream == nil {