Skip to content

Commit

Permalink
Merge pull request #39 from Ruff-nono/master
Browse files Browse the repository at this point in the history
fix status error
  • Loading branch information
vearne authored May 28, 2024
2 parents a82a1f8 + c3cfe94 commit a3fdea3
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 a3fdea3

Please sign in to comment.