Skip to content

Commit

Permalink
fix bug with range headers
Browse files Browse the repository at this point in the history
  • Loading branch information
i5heu committed Nov 21, 2022
1 parent d6f81a0 commit 1192c59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/simple-S3-cache/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (h *Handler) handler(ctx *fasthttp.RequestCtx) {
}
// HTTP 206 (Partial Content)
ctx.Response.SetStatusCode(206)
ctx.Response.Header.Set("Content-Range", fmt.Sprintf("bytes %d-%d/%d", ranges[0].Start, ranges[0].Start+ranges[0].Length, size))
ctx.Response.Header.Set("Content-Range", fmt.Sprintf("bytes %d-%d/%d", ranges[0].Start, ranges[0].Start+ranges[0].Length-1, size))
ctx.Response.Header.Set("Content-Length", strconv.FormatUint(uint64(ranges[0].Length), 10))
ctx.Response.Header.Set("Content-Type", dataResult.MIME)
} else {
Expand Down

0 comments on commit 1192c59

Please sign in to comment.