From 0256d8140cd176ff6c79dd6997be58a0fcbdb684 Mon Sep 17 00:00:00 2001 From: Mikhail Kshevetskiy Date: Sat, 28 Dec 2024 13:46:34 +0300 Subject: [PATCH] test/cmd/wget: replace bogus response with an actual response from the HTTP server According to HTTP/1.0 standard the HTTP reply consist of * Status Line + CRLF * Zero or more Response Header Fields (each ended with CRLF) * CRLF on new line (Response Header Fields end marker) * Optional Entity Body. Thus in response headers we state: Content-Length = 30 but actual transferred file data is: "\r\nHi\r\n". This is 32 bytes of data. So we get and check for correctness 32 bytes of data, but * The response we are used is incorrect, real server will set Content-Length to 32. * default_wget_info->hdr_cont_len will be set to wrong value 30 (used for efi http booting). Fix an issue by: * replace bogus response with an actual response from the HTTP server * format response to show HTTP response structure * recalculate md5sum as transferred file data has been changed. The server response was captured with the commands echo -ne "Hi\n" > ~/public_html/test.html echo -ne "GET /~${USER}/test.html HTTP/1.0\r\n\r\n" | netcat localhost 80 >reply.txt Signed-off-by: Mikhail Kshevetskiy (cherry picked from commit ece1631f5e1d12477a9fd439570a3f05e4e8fb1e)