Bugfix: wget --spider sends GET instead of HEAD

Jake jake at signedbit.net
Sat Aug 7 18:18:49 UTC 2021


Hi BusyBox Team,

First and foremost, thank you all for your excellent work! It is appreciated tremendously.

There is a small bug in `wget' applet.

In GNU wget[1], `--spider' first issues a HEAD request, then iff HEAD fails, issues a GET request. In Busybox wget, only a GET request is sent. According to the HTTP spec[2], Busybox wget impl is technically correct. However, it causes portability problems. Interestingly, GNU wget man page[3] does not explicitly specify HTTP method.

Attached is patch to fix. Note: this is still not totally compatible with GNU wget because it does not retry with GET if HEAD fails.

Thank you,
Jake

[1] https://git.savannah.gnu.org/cgit/wget.git/tree/src/http.c#n4304
[2] https://httpwg.org/specs/rfc7231.html#HEAD
[3] https://www.gnu.org/software/wget/manual/wget.html#index-spider
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20210807/935cc68b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wget_spider_fix.diff
Type: text/x-patch
Size: 514 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20210807/935cc68b/attachment.bin>


More information about the busybox mailing list