| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
lgtm
Sorry, something went wrong.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #5490 +/- ##
=======================================
Coverage 93.45% 93.46%
=======================================
Files 110 110
Lines 37147 37150 +3
=======================================
+ Hits 34716 34721 +5
+ Misses 2431 2429 -2 ☔ View full report in Codecov by Harness.
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
The "simple range header value" parser rejected valid open-ended ranges such
as bytes=5-.
Per https://fetch.spec.whatwg.org/#simple-range-header-value step 18, the
"start greater than end" failure only applies when rangeStartValue and
rangeEndValue are both numbers. For an open-ended range like bytes=5-,
rangeEndValue is null. The code compared rangeStartValue > rangeEndValue
directly, and JavaScript coerces null to 0 in that comparison, so 5 > null
becomes 5 > 0, which is true, and the parser returned failure.
The effect is that fetch() of a blob: URL with Range: bytes=5- returned a
network error and the promise rejected, instead of returning a 206 Partial
Content. bytes=0- worked only by accident because 0 does not exceed 0.
This change guards the comparison so it runs only when both values are numbers,
matching the spec. A genuinely inverted range such as bytes=5-3 still returns
failure, and the null-null case is already handled by step 17.
Added a test that fetches a blob URL with Range: bytes=5- and asserts a 206
response with the correct body and Content-Range.