Skip to content

Commit

Permalink
fix: use ChunkedBodyWriter
Browse files Browse the repository at this point in the history
  • Loading branch information
li-jin-gou committed May 4, 2023
1 parent 5b0bd5a commit 9dd0fc8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 55 deletions.
4 changes: 3 additions & 1 deletion sse.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package sse
import (
"strings"

"github.com/cloudwego/hertz/pkg/protocol/http1/resp"

"github.com/cloudwego/hertz/pkg/app"
"github.com/cloudwego/hertz/pkg/network"
)
Expand Down Expand Up @@ -65,7 +67,7 @@ func NewStream(c *app.RequestContext) *Stream {
c.Response.Header.Set(cacheControl, noCache)
}

writer := NewStreamBodyWriter(&c.Response, c.GetWriter())
writer := resp.NewChunkedBodyWriter(&c.Response, c.GetWriter())
c.Response.HijackWriter(writer)
return &Stream{
writer,
Expand Down
54 changes: 0 additions & 54 deletions writer.go

This file was deleted.

0 comments on commit 9dd0fc8

Please sign in to comment.