mirror of
https://github.com/mirror/wget.git
synced 2025-01-06 10:20:56 +08:00
* 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:
parent
04b7369490
commit
46a6e2957e
16
src/http.c
16
src/http.c
@ -1783,27 +1783,15 @@ read_response_body (struct http_stat *hs, int sock, FILE *fp, wgint contlen,
|
|||||||
&& (c_isspace (line[sizeof (string_constant) - 1]) \
|
&& (c_isspace (line[sizeof (string_constant) - 1]) \
|
||||||
|| !line[sizeof (string_constant) - 1]))
|
|| !line[sizeof (string_constant) - 1]))
|
||||||
|
|
||||||
#ifdef __VMS
|
|
||||||
#define SET_USER_AGENT(req) do { \
|
#define SET_USER_AGENT(req) do { \
|
||||||
if (!opt.useragent) \
|
if (!opt.useragent) \
|
||||||
request_set_header (req, "User-Agent", \
|
request_set_header (req, "User-Agent", \
|
||||||
aprintf ("Wget/%s (VMS %s %s)", \
|
aprintf ("Wget/%s", \
|
||||||
version_string, vms_arch(), vms_vers()), \
|
version_string), \
|
||||||
rel_value); \
|
rel_value); \
|
||||||
else if (*opt.useragent) \
|
else if (*opt.useragent) \
|
||||||
request_set_header (req, "User-Agent", opt.useragent, rel_none); \
|
request_set_header (req, "User-Agent", opt.useragent, rel_none); \
|
||||||
} while (0)
|
} 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
|
Convert time_t to one of valid HTTP date formats
|
||||||
|
Loading…
Reference in New Issue
Block a user