diff --git a/httputils/fasthttp.go b/httputils/fasthttp.go index aa43aed..a31bba4 100644 --- a/httputils/fasthttp.go +++ b/httputils/fasthttp.go @@ -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 { diff --git a/httputils/nethttp.go b/httputils/nethttp.go index b2bf296..c97367f 100644 --- a/httputils/nethttp.go +++ b/httputils/nethttp.go @@ -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 {