* src/http.c: Do not reveal OS type to server via User-Agent: header

Following the "privacy by design" principle, which is now European law by
virtue of the GDPR since 2018, the client should not transmit the operating
system.

Fixes #57884
Reported-by: Bruno Haible
This commit is contained in:
Tim Rühsen 2020-02-23 18:51:06 +01:00
parent 04b7369490
commit 46a6e2957e

View File

@ -1783,27 +1783,15 @@ read_response_body (struct http_stat *hs, int sock, FILE *fp, wgint contlen,
&& (c_isspace (line[sizeof (string_constant) - 1]) \
|| !line[sizeof (string_constant) - 1]))
#ifdef __VMS
#define SET_USER_AGENT(req) do { \
if (!opt.useragent) \
request_set_header (req, "User-Agent", \
aprintf ("Wget/%s (VMS %s %s)", \
version_string, vms_arch(), vms_vers()), \
aprintf ("Wget/%s", \
version_string), \
rel_value); \
else if (*opt.useragent) \
request_set_header (req, "User-Agent", opt.useragent, rel_none); \
} while (0)
#else /* def __VMS */
#define SET_USER_AGENT(req) do { \
if (!opt.useragent) \
request_set_header (req, "User-Agent", \
aprintf ("Wget/%s (%s)", \
version_string, OS_TYPE), \
rel_value); \
else if (*opt.useragent) \
request_set_header (req, "User-Agent", opt.useragent, rel_none); \
} while (0)
#endif /* def __VMS [else] */
/*
Convert time_t to one of valid HTTP date formats