diff --git a/.circleci/test-run.sh b/.circleci/test-run.sh index dafef6f4..5b8e1502 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 + diff --git a/README.md b/README.md index 1da9073c..a5849e36 100644 --- a/README.md +++ b/README.md @@ -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 be5a51bd..02f1535e 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) }