We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe04b59 commit 7fbdbc9Copy full SHA for 7fbdbc9
1 file changed
header.go
@@ -1,5 +1,7 @@
1
package replify
2
3
+import "net/http"
4
+
5
// WithCode sets the `code` field of the `header` instance.
6
//
7
// This function assigns the provided integer value to the `code` field of the `header`
@@ -11,6 +13,9 @@ package replify
11
13
// Returns:
12
14
// - The updated `header` instance with the `code` field set to the provided value.
15
func (h *header) WithCode(v int) *header {
16
+ if v < 100 || v > 599 {
17
+ v = http.StatusInternalServerError
18
+ }
19
h.code = v
20
return h
21
}
0 commit comments