Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/handler/unrouted_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand, this is not entirely correct since the blob might actually not have been completed yet.

I think we should check if we can limit the changes to the azure store.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe something liks this could work?

  • Get commited and uncommited blocks in GetOffset. If there are NO uncommitted blobs then return just those
  • Set the offset in NewUpload of the azure store to 0 and ensure a single empty uncommitted blob is created, if there is a enableVersionedBlobs flag set

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetFile method is used for handling the GET request and downloading the files. If you try to use this method on the file which is not uploaded completely as you suggest, it would throw ERR_UPLOAD_NOT_FOUND

Copy link
Contributor

@quality-leftovers quality-leftovers Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed that. Just did some testing and you are absolutely right 👍 . Ignore this comment.

"Content-Type": contentType,
"Content-Disposition": contentDisposition,
},
Expand Down Expand Up @@ -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
Expand Down
Loading