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 b28c324 commit 00e55ddCopy full SHA for 00e55dd
1 file changed
modules/context/response.go
@@ -4,7 +4,9 @@
4
5
package context
6
7
-import "net/http"
+import (
8
+ "net/http"
9
+)
10
11
// ResponseWriter represents a response writer for HTTP
12
type ResponseWriter interface {
@@ -60,8 +62,10 @@ func (r *Response) WriteHeader(statusCode int) {
60
62
}
61
63
r.beforeExecuted = true
64
- r.status = statusCode
- r.ResponseWriter.WriteHeader(statusCode)
65
+ if r.status == 0 {
66
+ r.status = statusCode
67
+ r.ResponseWriter.WriteHeader(statusCode)
68
+ }
69
70
71
// Flush flush cached data
0 commit comments