(writer http.ResponseWriter, htmlContent []byte)
| 933 | } |
| 934 | |
| 935 | func (this *CaptchaValidator) compressBR(writer http.ResponseWriter, htmlContent []byte) { |
| 936 | compressWriter, err := compressions.NewBrotliWriter(writer, 0) |
| 937 | if err != nil { |
| 938 | writer.Header().Set("Content-Length", types.String(len(htmlContent))) |
| 939 | writer.WriteHeader(http.StatusOK) |
| 940 | _, _ = writer.Write(htmlContent) |
| 941 | return |
| 942 | } |
| 943 | |
| 944 | writer.Header().Set("Content-Encoding", "br") |
| 945 | writer.WriteHeader(http.StatusOK) |
| 946 | _, _ = compressWriter.Write(htmlContent) |
| 947 | _ = compressWriter.Close() |
| 948 | } |
| 949 | |
| 950 | func (this *CaptchaValidator) compressGzip(writer http.ResponseWriter, htmlContent []byte) { |
| 951 | compressWriter, err := compressions.NewGzipWriter(writer, 0) |
no test coverage detected