wget: ignore header casing

HTTP headers are case insensitive and therefore 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@posteo.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
master
Sertonix 2024-06-08 18:05:44 +00:00 committed by Denys Vlasenko
parent a6ce017a8a
commit 9f262698cc
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}