aboutsummaryrefslogtreecommitdiff
path: root/weed/server/volume_server_handlers_read.go
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2021-05-24 00:39:55 -0700
committerGitHub <noreply@github.com>2021-05-24 00:39:55 -0700
commit15859a7daabd637cd91dede2cfc76d874e7174a4 (patch)
tree5eb4f327c53e2525d372d19bce62984539c62e71 /weed/server/volume_server_handlers_read.go
parent359a08ecbad0b010811af367c2a2677fadfb53ae (diff)
parent84dce32a5781268f6dbd0101e3bab65c04e0a1c7 (diff)
downloadseaweedfs-15859a7daabd637cd91dede2cfc76d874e7174a4.tar.xz
seaweedfs-15859a7daabd637cd91dede2cfc76d874e7174a4.zip
Merge pull request #2074 from kmlebedev/head_check_all_chunks
avoid http error: superfluous response.WriteHeader
Diffstat (limited to 'weed/server/volume_server_handlers_read.go')
-rw-r--r--weed/server/volume_server_handlers_read.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/weed/server/volume_server_handlers_read.go b/weed/server/volume_server_handlers_read.go
index 2db46ac9b..3e977cfd4 100644
--- a/weed/server/volume_server_handlers_read.go
+++ b/weed/server/volume_server_handlers_read.go
@@ -27,7 +27,7 @@ var fileNameEscaper = strings.NewReplacer(`\`, `\\`, `"`, `\"`)
func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request) {
- // println(r.Method + " " + r.URL.Path)
+ glog.V(9).Info(r.Method + " " + r.URL.Path + " " + r.Header.Get("Range"))
stats.VolumeServerRequestCounter.WithLabelValues("get").Inc()
start := time.Now()
@@ -261,13 +261,10 @@ func writeResponseContent(filename, mimeType string, rs io.ReadSeeker, w http.Re
return nil
}
- processRangeRequest(r, w, totalSize, mimeType, func(writer io.Writer, offset int64, size int64, httpStatusCode int) error {
+ processRangeRequest(r, w, totalSize, mimeType, func(writer io.Writer, offset int64, size int64) error {
if _, e = rs.Seek(offset, 0); e != nil {
return e
}
- if httpStatusCode != 0 {
- w.WriteHeader(httpStatusCode)
- }
_, e = io.CopyN(writer, rs, size)
return e
})