fix: set status not work

This commit is contained in:
loveuer 2024-05-22 14:08:34 +08:00
parent 479c4eef57
commit 16541e377c
2 changed files with 3 additions and 3 deletions

4
ctx.go
View File

@ -255,8 +255,8 @@ func (c *Ctx) Status(code int) *Ctx {
c.lock.Lock()
defer c.lock.Unlock()
c.StatusCode = code
c.writermem.status = code
c.writermem.WriteHeader(code)
c.StatusCode = c.writermem.status
return c
}

View File

@ -103,7 +103,7 @@ func (w *responseWriter) Size() int {
}
func (w *responseWriter) Written() bool {
return w.size != noWritten || w.status != 0
return w.size != noWritten
}
// Hijack implements the http.Hijacker interface.