Skip to content

Commit

Permalink
fix status error
Browse files Browse the repository at this point in the history
  • Loading branch information
shaoshuai committed May 28, 2024
1 parent a82a1f8 commit c3cfe94
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,10 @@ func (tw *TimeoutWriter) Header() http.Header {
func (tw *TimeoutWriter) Size() int {
return tw.size
}

func (tw *TimeoutWriter) Status() int {
if tw.code == 0 || !tw.wroteHeader.Load() {
return tw.ResponseWriter.Status()
}
return tw.code
}

0 comments on commit c3cfe94

Please sign in to comment.