Repository navigation
Commit ce4536f
fix: keep the favicon body under reachable-url v2 (#865)
v2 cancels the download once the headers answer reachability, so `body`
comes back undefined whenever a server ignores `Range`. The resolver
drops every favicon it probes without one, and nine tests here fail on
the bump alone.
`maxBody: 1` keeps the byte the check reads, and it is the byte the range
request already asks for, so nothing extra is downloaded.
Reading one byte narrows what an absent body means. It used to cover a
transfer that stopped part way, because the whole entity was downloaded
anyway; now it covers a server that announces an image and sends none of
it. Keeping the wider meaning would have meant either buffering whatever
a guessed URL answers with, or a size bound standing in for completion,
and a favicon whose transfer wobbled is not worth either: the consumer
refetches the URL regardless.
`undefined if body is not present` asserts the narrower guarantee, and
still fails without the check it covers.
Claude-Session: https://claude.ai/code/session_018JDsM3McLV5LtR3rFd97Sb
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>1 parent 440ebd1 commit ce4536f
4 files changed
Lines changed: 12 additions & 9 deletions
File tree
- packages
- metascraper-logo-favicon
- src
- test
- metascraper-youtube
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
| |||
148 | 150 | | |
149 | 151 | | |
150 | 152 | | |
151 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
152 | 156 | | |
153 | 157 | | |
154 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
| 27 | + | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 31 | + | |
| 32 | + | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
0 commit comments