[PATCH] wget: ignore header casing
Denys Vlasenko
vda.linux at googlemail.com
Mon Jul 8 13:03:28 UTC 2024
Applied, thank you
On Sat, Jun 8, 2024 at 8:05 PM Sertonix <sertonix at posteo.net> wrote:
>
> HTTP headers are case insensitive and therefor the check if a default
> header has been overwritten needs to be case insensitive.
>
> Without this patch `--header 'user-agent: test'` results in
> `User-Agent: Wget` and `user-agent: test` being send.
>
> function old new delta
> ------------------------------------------------------------------------------
> (add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0) Total: 0 bytes
> text data bss dec hex filename
> 1040876 16443 1840 1059159 102957 busybox_old
> 1040876 16443 1840 1059159 102957 busybox_unstripped
>
> Signed-off-by: Sertonix <sertonix at posteo.net>
> ---
> networking/wget.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/networking/wget.c b/networking/wget.c
> index 199ddd4da..512bebfc2 100644
> --- a/networking/wget.c
> +++ b/networking/wget.c
> @@ -1602,7 +1602,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0")
> bit = 1;
> words = wget_user_headers;
> while (*words) {
> - if (strstr(hdr, words) == hdr) {
> + if (strcasestr(hdr, words) == hdr) {
> G.user_headers |= bit;
> break;
> }
> --
> 2.45.2
>
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
More information about the busybox
mailing list