fix(fetch): use headersList for Range check on opaque 206 response#5043
fix(fetch): use headersList for Range check on opaque 206 response#5043deepview-autofix wants to merge 1 commit intonodejs:mainfrom
Conversation
The internal request state has a `headersList` property, not `headers`.
Accessing `request.headers.contains('range', true)` would throw a
TypeError when processing an opaque response with status 206 and the
range-requested flag set.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: DeepView Autofix <276251120+deepview-autofix@users.noreply.github.com>
Co-Authored-By: Nikita Skovoroda <chalkerx@gmail.com>
Signed-off-by: Nikita Skovoroda <chalkerx@gmail.com>
KhafraDev
left a comment
There was a problem hiding this comment.
The fix looks correct, could you add a test?
|
@KhafraDev for this one too, agent claimed the code is actually dead, and opted out from making a test:
That might be a mistake though If anyone can write a test for this it would be nice |
|
Lines 26 to 37 in bc0a19c A test similar to this one perhaps? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5043 +/- ##
==========================================
- Coverage 93.03% 93.03% -0.01%
==========================================
Files 110 110
Lines 35793 35793
==========================================
- Hits 33301 33300 -1
- Misses 2492 2493 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The internal request state has a
headersListproperty, notheaders. Accessingrequest.headers.contains('range', true)would throw a TypeError when processing an opaque response with status 206 and the range-requested flag set.