@ -105,7 +105,7 @@ func GetHandler(w http.ResponseWriter, r *http.Request) {
if ext != "" {
mtype := mime.TypeByExtension(ext)
w.Header().Set("Content-Type", mtype)
if storage.IsCompressable(ext, mtype) {
if storage.IsGzippable(ext, mtype) {
if strings.Contains(r.Header.Get("Accept-Encoding"), "gzip") {
w.Header().Set("Content-Encoding", "gzip")
} else {
@ -8,12 +8,12 @@ import (
"strings"
)
func IsCompressable(ext, mtype string) bool {
func IsGzippable(ext, mtype string) bool {
if ext == ".zip" {
return true
return false
}
if ext == ".rar" {
if strings.Index(mtype,"text/")==0 {
@ -40,7 +40,7 @@ func NewNeedle(r *http.Request) (n *Needle, fname string, e error) {
if dotIndex > 0 {
ext := fname[dotIndex:]
if IsCompressable(ext, mtype) {
if IsGzippable(ext, mtype) {
data = GzipData(data)