diff --git a/pkg/handler/get_test.go b/pkg/handler/get_test.go index a2b2e26b4..518ab80e9 100644 --- a/pkg/handler/get_test.go +++ b/pkg/handler/get_test.go @@ -59,7 +59,7 @@ func TestGet(t *testing.T) { Method: "GET", URL: "yes", ResHeader: map[string]string{ - "Content-Length": "5", + "Content-Length": "20", "Content-Type": "image/jpeg", "Content-Disposition": `inline;filename="file.jpg\"evil"`, }, diff --git a/pkg/handler/unrouted_handler.go b/pkg/handler/unrouted_handler.go index 8d2e690f7..68870cda6 100644 --- a/pkg/handler/unrouted_handler.go +++ b/pkg/handler/unrouted_handler.go @@ -1058,7 +1058,7 @@ func (handler *UnroutedHandler) GetFile(w http.ResponseWriter, r *http.Request) resp := HTTPResponse{ StatusCode: http.StatusOK, Header: HTTPHeader{ - "Content-Length": strconv.FormatInt(info.Offset, 10), + "Content-Length": strconv.FormatInt(info.Size, 10), "Content-Type": contentType, "Content-Disposition": contentDisposition, }, @@ -1087,7 +1087,7 @@ func (handler *UnroutedHandler) GetFile(w http.ResponseWriter, r *http.Request) } // If no data has been uploaded yet, respond with an empty "204 No Content" status. - if info.Offset == 0 { + if info.Size == 0 { resp.StatusCode = http.StatusNoContent handler.sendResp(c, resp) return