|
|
@ -244,13 +244,13 @@ func writeResponseContent(filename, mimeType string, rs io.ReadSeeker, w http.Re |
|
|
|
} |
|
|
|
w.Header().Set("Accept-Ranges", "bytes") |
|
|
|
|
|
|
|
adjustHeaders(w, r, filename) |
|
|
|
|
|
|
|
if r.Method == "HEAD" { |
|
|
|
w.Header().Set("Content-Length", strconv.FormatInt(totalSize, 10)) |
|
|
|
return nil |
|
|
|
} |
|
|
|
|
|
|
|
adjustHeadersAfterHEAD(w, r, filename) |
|
|
|
|
|
|
|
processRangeRequest(r, w, totalSize, mimeType, func(writer io.Writer, offset int64, size int64) error { |
|
|
|
if _, e = rs.Seek(offset, 0); e != nil { |
|
|
|
return e |
|
|
|