mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
volume: avoid special logic for .gz files
This commit is contained in:
parent
f89186a3cf
commit
49199c69d4
|
@ -26,6 +26,8 @@ var fileNameEscaper = strings.NewReplacer("\\", "\\\\", "\"", "\\\"")
|
||||||
|
|
||||||
func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request) {
|
func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
|
// println(r.Method + " " + r.URL.Path)
|
||||||
|
|
||||||
stats.VolumeServerRequestCounter.WithLabelValues("get").Inc()
|
stats.VolumeServerRequestCounter.WithLabelValues("get").Inc()
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
defer func() { stats.VolumeServerRequestHistogram.WithLabelValues("get").Observe(time.Since(start).Seconds()) }()
|
defer func() { stats.VolumeServerRequestHistogram.WithLabelValues("get").Observe(time.Since(start).Seconds()) }()
|
||||||
|
@ -142,7 +144,6 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ext != ".gz" && ext != ".zst" {
|
|
||||||
if n.IsCompressed() {
|
if n.IsCompressed() {
|
||||||
if _, _, _, shouldResize := shouldResizeImages(ext, r); shouldResize {
|
if _, _, _, shouldResize := shouldResizeImages(ext, r); shouldResize {
|
||||||
if n.Data, err = util.DecompressData(n.Data); err != nil {
|
if n.Data, err = util.DecompressData(n.Data); err != nil {
|
||||||
|
@ -158,7 +159,6 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
rs := conditionallyResizeImages(bytes.NewReader(n.Data), ext, r)
|
rs := conditionallyResizeImages(bytes.NewReader(n.Data), ext, r)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue