Skip to content

Conversation

MariuszBartnik
Copy link
Contributor

Use info.Size instead of info.Offset while setting the headers for http request when downloading a file.

Fix for #1286 - tested for Azure

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants