question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What are the format/contents of the ContentRange string

See original GitHub issue

It would be helpful if this page described the format for this string. Just saying it’s a string isn’t that valuable.

Looking at the code in sdk\storage\Azure.Storage.Blobs\src\Models\ContentRange.cs I see the below comments, so I assume this is the format.

To be extra helpful, it would also be good to know if Azure Blob Storage ever does return * for the blob size, of if you can reliably get the size in bytes of the blob from this field when requesting ranges.

            /* Parse header value (e.g. "<unit> <start>-<end>/<blobSize>")
             * Either side of the "/" can be an asterisk, so possible results include:
             *   [<unit>, <start>, <end>, <blobSize>]
             *   [<unit>, "*", <blobSize>]
             *   [<unit>, <start>, <end>, "*"]
             *   [<unit>, "*", "*"] (unsure if possible but not hard to support)
             * "End" is the inclusive last byte; e.g. header "bytes 0-7/8" is the entire 8-byte blob
             */

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
amnguyecommented, Mar 2, 2022

Hi, sorry about that, I think I was quick editting it and missed that part.

The following documentation won’t exactly look this but should look something similar like this. This might change depending on feedback during code review.

/* Parse header value (e.g. "<unit> <start>-<end>/<blobSize>")
* "End" is the inclusive last byte; e.g. header "bytes 0-7/8" is the entire 8-byte blob
*/

I might have to update this further once I gather more information and feedback.

0reactions
billticommented, Mar 2, 2022

Thanks @amnguye . So to clarify, as of today, the content-range header returned is always of the format “bytes x-y/z”, where x, y, and z are integers? The code comment you included in your post still states Either side of the "/" can be an asterisk, but your wording also states The service does not utilize passing back a * in the content range, which seems contradictory.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Content-Range - HTTP - MDN Web Docs - Mozilla
The Content-Range response HTTP header indicates where in a full body message a partial message belongs. Header type, Response header, Payload ...
Read more >
HTTP range requests - MDN Web Docs - Mozilla
The Content-Range response header indicates where in the full resource this partial message belongs. Multipart ranges. The Range header also ...
Read more >
Standard numeric format strings
In this article, learn to use standard numeric format strings to format common numeric types into text representations in .NET.
Read more >
String.Format Method (System)
Converts the value of objects to strings based on the formats specified and inserts them into another string. If you are new to...
Read more >
What's the "Content-Length" field in HTTP header?
It's the number of bytes of data in the body of the request or response. The body is the part that comes after...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found