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 9045eb7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 55 deletions.
3 changes: 2 additions & 1 deletion sse.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package sse

import (

Check failure on line 19 in sse.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofumpt`-ed with `-extra` (gofumpt)
"github.com/cloudwego/hertz/pkg/protocol/http1/resp"
"strings"

Check failure on line 21 in sse.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofumpt`-ed with `-extra` (gofumpt)

"github.com/cloudwego/hertz/pkg/app"
Expand Down Expand Up @@ -65,7 +66,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 9045eb7

Please sign in to comment.