Skip to content

Commit

Permalink
Merge branch 'ponzu-dev' of https://github.com/ponzu-cms/ponzu into p…
Browse files Browse the repository at this point in the history
…onzu-dev
  • Loading branch information
nilslice committed Jan 8, 2018
2 parents 3c8d90c + acfd3de commit b1f5024
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 5 additions & 1 deletion .circleci/test-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ curl -v --cookie-jar cookies \

#Test that content types were generated
curl -b cookies -c cookies http://localhost:8080/admin/contents?type=Person \
| grep Person
| grep Person

curl -b cookies -c cookies http://localhost:8080/admin/contents?type=Message \
| grep Message

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ the type of HTML view an editor field is presented within. If no third parameter
is added, a plain text HTML input will be generated. In the example above, the
argument shown as `body:string:richtext` would show the Richtext input instead
of a plain text HTML input (as shown in the screenshot). The following input
view specifiers are implmeneted:
view specifiers are implemented:

| CLI parameter | Generates |
|---------------|-----------|
Expand Down
7 changes: 4 additions & 3 deletions system/api/gzip.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ func Gzip(next http.HandlerFunc) http.HandlerFunc {
if strings.Contains(req.Header.Get("Accept-Encoding"), "gzip") {
// gzip response data
res.Header().Set("Content-Encoding", "gzip")
gzWriter := gzip.NewWriter(res)
defer gzWriter.Close()
var gzres gzipResponseWriter
if pusher, ok := res.(http.Pusher); ok {
gzres = gzipResponseWriter{res, pusher, gzip.NewWriter(res)}
gzres = gzipResponseWriter{res, pusher, gzWriter}
} else {
gzres = gzipResponseWriter{res, nil, gzip.NewWriter(res)}
gzres = gzipResponseWriter{res, nil, gzWriter}
}

next.ServeHTTP(gzres, req)
Expand All @@ -43,7 +45,6 @@ type gzipResponseWriter struct {
}

func (gzw gzipResponseWriter) Write(p []byte) (int, error) {
defer gzw.gw.Close()
return gzw.gw.Write(p)
}

Expand Down

0 comments on commit b1f5024

Please sign in to comment.