Skip to content

Commit 7fbdbc9

Browse files
committed
♻️ refactor: update codebase #2
1 parent fe04b59 commit 7fbdbc9

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

header.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package replify
22

3+
import "net/http"
4+
35
// WithCode sets the `code` field of the `header` instance.
46
//
57
// This function assigns the provided integer value to the `code` field of the `header`
@@ -11,6 +13,9 @@ package replify
1113
// Returns:
1214
// - The updated `header` instance with the `code` field set to the provided value.
1315
func (h *header) WithCode(v int) *header {
16+
if v < 100 || v > 599 {
17+
v = http.StatusInternalServerError
18+
}
1419
h.code = v
1520
return h
1621
}

0 commit comments

Comments
 (0)