adding compressiong support!
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@59 282b0af5-e82d-9cf1-ede4-77906d7719d0
This commit is contained in:
@@ -62,7 +62,11 @@ func GetHandler(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if ext != "" {
|
||||
w.Header().Set("Content-Type", mime.TypeByExtension(ext))
|
||||
mtype := mime.TypeByExtension(ext)
|
||||
w.Header().Set("Content-Type", mtype)
|
||||
if storage.IsCompressable(ext, mtype){
|
||||
w.Header().Set("Content-Encoding", "gzip")
|
||||
}
|
||||
}
|
||||
w.Write(n.Data)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user