mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
parent
cad7fd8775
commit
f022aff289
|
@ -274,7 +274,7 @@ func processRangeRequest(r *http.Request, w http.ResponseWriter, totalSize int64
|
||||||
ra := ranges[0]
|
ra := ranges[0]
|
||||||
w.Header().Set("Content-Length", strconv.FormatInt(ra.length, 10))
|
w.Header().Set("Content-Length", strconv.FormatInt(ra.length, 10))
|
||||||
w.Header().Set("Content-Range", ra.contentRange(totalSize))
|
w.Header().Set("Content-Range", ra.contentRange(totalSize))
|
||||||
// w.WriteHeader(http.StatusPartialContent)
|
w.WriteHeader(http.StatusPartialContent)
|
||||||
|
|
||||||
err = writeFn(w, ra.start, ra.length)
|
err = writeFn(w, ra.start, ra.length)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -315,7 +315,7 @@ func processRangeRequest(r *http.Request, w http.ResponseWriter, totalSize int64
|
||||||
if w.Header().Get("Content-Encoding") == "" {
|
if w.Header().Get("Content-Encoding") == "" {
|
||||||
w.Header().Set("Content-Length", strconv.FormatInt(sendSize, 10))
|
w.Header().Set("Content-Length", strconv.FormatInt(sendSize, 10))
|
||||||
}
|
}
|
||||||
// w.WriteHeader(http.StatusPartialContent)
|
w.WriteHeader(http.StatusPartialContent)
|
||||||
if _, err := io.CopyN(w, sendContent, sendSize); err != nil {
|
if _, err := io.CopyN(w, sendContent, sendSize); err != nil {
|
||||||
http.Error(w, "Internal Error", http.StatusInternalServerError)
|
http.Error(w, "Internal Error", http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue