Skip to content

Commit 37ba690

Browse files
author
Igor Dolzhikov
committed
Merge branch 'hotfix/0.3.1'
2 parents 2c080d5 + 302a255 commit 37ba690

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

control.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,16 @@ func (c *Control) Body(data interface{}) {
115115
}
116116
if strings.Contains(c.Request.Header.Get("Accept-Encoding"), "gzip") {
117117
c.Writer.Header().Add("Content-Encoding", "gzip")
118-
c.Writer.WriteHeader(c.code)
118+
if c.code > 0 {
119+
c.Writer.WriteHeader(c.code)
120+
}
119121
gz := gzip.NewWriter(c.Writer)
120122
gz.Write(content)
121123
gz.Close()
122124
} else {
123-
c.Writer.WriteHeader(c.code)
125+
if c.code > 0 {
126+
c.Writer.WriteHeader(c.code)
127+
}
124128
c.Writer.Write(content)
125129
}
126130
}

router.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// license that can be found in the LICENSE file.
44

55
/*
6-
Package router 0.3.0 provides fast HTTP request router.
6+
Package router 0.3.1 provides fast HTTP request router.
77
88
The router matches incoming requests by the request method and the path.
99
If a handle is registered for this path and method, the router delegates the

0 commit comments

Comments
 (0)