Close streams on request completion
This commit is contained in:
parent
10187307da
commit
475b799818
|
@ -82,6 +82,7 @@ func (c *FastHTTPContext) SetResponseHeader(name string, value string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *FastHTTPContext) ServeStream(stream Stream) {
|
func (c *FastHTTPContext) ServeStream(stream Stream) {
|
||||||
|
defer stream.Close()
|
||||||
const rangePrefix = "bytes="
|
const rangePrefix = "bytes="
|
||||||
|
|
||||||
if stream == nil {
|
if stream == nil {
|
||||||
|
|
|
@ -83,6 +83,7 @@ func (c *NetHTTPContext) SetResponseHeader(name string, value string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *NetHTTPContext) ServeStream(stream Stream) {
|
func (c *NetHTTPContext) ServeStream(stream Stream) {
|
||||||
|
defer stream.Close()
|
||||||
const rangePrefix = "bytes="
|
const rangePrefix = "bytes="
|
||||||
|
|
||||||
if stream == nil {
|
if stream == nil {
|
||||||
|
|
Loading…
Reference in a new issue