(writer http.ResponseWriter, htmlContent []byte)
| 948 | } |
| 949 | |
| 950 | func (this *CaptchaValidator) compressGzip(writer http.ResponseWriter, htmlContent []byte) { |
| 951 | compressWriter, err := compressions.NewGzipWriter(writer, 0) |
| 952 | if err != nil { |
| 953 | writer.Header().Set("Content-Length", types.String(len(htmlContent))) |
| 954 | writer.WriteHeader(http.StatusOK) |
| 955 | _, _ = writer.Write(htmlContent) |
| 956 | return |
| 957 | } |
| 958 | |
| 959 | writer.Header().Set("Content-Encoding", "gzip") |
| 960 | writer.WriteHeader(http.StatusOK) |
| 961 | _, _ = compressWriter.Write(htmlContent) |
| 962 | _ = compressWriter.Close() |
| 963 | } |
| 964 | |
| 965 | func (this *CaptchaValidator) setCookie(writer http.ResponseWriter, setId int64, life int) { |
| 966 | if life < 1 { |
no test coverage detected