aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSertonix <sertonix@posteo.net>2024-06-08 18:05:44 +0000
committerDenys Vlasenko <vda.linux@googlemail.com>2024-07-08 15:02:58 +0200
commit9f262698cc7e6a8b5621f018645f3c1fa06b226f (patch)
treef2bfe662618da83aa13fb17801c0c3a59543d2a7
parenta6ce017a8a2db09c6f23aa6abf7ce21fd00c2fdf (diff)
downloadbusybox-w32-9f262698cc7e6a8b5621f018645f3c1fa06b226f.tar.gz
busybox-w32-9f262698cc7e6a8b5621f018645f3c1fa06b226f.tar.bz2
busybox-w32-9f262698cc7e6a8b5621f018645f3c1fa06b226f.zip
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>
-rw-r--r--networking/wget.c2
1 files changed, 1 insertions, 1 deletions
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")
1602 bit = 1; 1602 bit = 1;
1603 words = wget_user_headers; 1603 words = wget_user_headers;
1604 while (*words) { 1604 while (*words) {
1605 if (strstr(hdr, words) == hdr) { 1605 if (strcasestr(hdr, words) == hdr) {
1606 G.user_headers |= bit; 1606 G.user_headers |= bit;
1607 break; 1607 break;
1608 } 1608 }