diff options
author | Steve Manuel <nilslice@gmail.com> | 2018-01-08 09:37:04 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2018-01-08 09:37:04 -0700 |
commit | b1f5024ed10580b8437bc2e7f8f90f21fb14bc33 (patch) | |
tree | eae20671da895543c97d647c77034db43140c2a6 | |
parent | 3c8d90cf0d5e2af0a9a6adf508fffda7d636b9a6 (diff) | |
parent | acfd3deeb7efc8929dd4001acfa58fcac74203a1 (diff) |
Merge branch 'ponzu-dev' of https://github.com/ponzu-cms/ponzu into ponzu-dev
-rw-r--r-- | .circleci/test-run.sh | 6 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | system/api/gzip.go | 7 |
3 files changed, 10 insertions, 5 deletions
diff --git a/.circleci/test-run.sh b/.circleci/test-run.sh index dafef6f..5b8e150 100644 --- a/.circleci/test-run.sh +++ b/.circleci/test-run.sh @@ -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
\ No newline at end of file + | grep Person + +curl -b cookies -c cookies http://localhost:8080/admin/contents?type=Message \ + | grep Message + @@ -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 | |---------------|-----------| diff --git a/system/api/gzip.go b/system/api/gzip.go index be5a51b..02f1535 100644 --- a/system/api/gzip.go +++ b/system/api/gzip.go @@ -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) @@ -43,7 +45,6 @@ type gzipResponseWriter struct { } func (gzw gzipResponseWriter) Write(p []byte) (int, error) { - defer gzw.gw.Close() return gzw.gw.Write(p) } |