Skip to content
This repository was archived by the owner on Dec 17, 2025. It is now read-only.

Commit 89f024d

Browse files
authored
fix: use ChunkedBodyWriter (#2)
1 parent 5b0bd5a commit 89f024d

File tree

2 files changed

+3
-55
lines changed

2 files changed

+3
-55
lines changed

sse.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ package sse
1919
import (
2020
"strings"
2121

22+
"github.com/cloudwego/hertz/pkg/protocol/http1/resp"
23+
2224
"github.com/cloudwego/hertz/pkg/app"
2325
"github.com/cloudwego/hertz/pkg/network"
2426
)
@@ -65,7 +67,7 @@ func NewStream(c *app.RequestContext) *Stream {
6567
c.Response.Header.Set(cacheControl, noCache)
6668
}
6769

68-
writer := NewStreamBodyWriter(&c.Response, c.GetWriter())
70+
writer := resp.NewChunkedBodyWriter(&c.Response, c.GetWriter())
6971
c.Response.HijackWriter(writer)
7072
return &Stream{
7173
writer,

writer.go

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)