Compare commits

...

2 Commits

Author SHA1 Message Date
arshabbir
6ef2efa2ae
Merge 1818d94c5fe6dc89033952689bdf900a28c056c4 into c221133ee80c46e3a6c50717ca6f1b41d4ab7711 2025-10-16 02:30:02 +08:00
arshabbir
1818d94c5f save the return line #3116 2022-05-05 16:50:10 +05:30

View File

@ -1003,8 +1003,12 @@ func bodyAllowedForStatus(status int) bool {
}
// Status sets the HTTP response code.
func (c *Context) Status(code int) {
c.Writer.WriteHeader(code)
func (c *Context) Status(code int) error {
if code > 0 {
c.Writer.WriteHeader(code)
return nil
}
return errors.New("invalid status code")
}
// Header is an intelligent shortcut for c.Writer.Header().Set(key, value).