mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
Make the user-agent string a bit less verbose
We shouldn't pass things like the kernel version in the user agent string, as it may be a bit too revealing and is not really necessary. Reference: https://bugzilla.mozilla.org/show_bug.cgi?id=57555 Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
f9a7d8cba4
commit
318d5c4ba8
@ -179,14 +179,12 @@ static void localize(void)
|
|||||||
*/
|
*/
|
||||||
static void setuseragent(void)
|
static void setuseragent(void)
|
||||||
{
|
{
|
||||||
const char *pacman = "Pacman/" PACKAGE_VERSION;
|
|
||||||
const char *libalpm = "libalpm/" LIB_VERSION;
|
|
||||||
char agent[101];
|
char agent[101];
|
||||||
struct utsname un;
|
struct utsname un;
|
||||||
|
|
||||||
uname(&un);
|
uname(&un);
|
||||||
snprintf(agent, 100, "%s (%s %s %s; %s) %s", pacman, un.sysname,
|
snprintf(agent, 100, "pacman/" PACKAGE_VERSION " (%s %s) libalpm/" LIB_VERSION,
|
||||||
un.machine, un.release, setlocale(LC_MESSAGES, NULL), libalpm);
|
un.sysname, un.machine);
|
||||||
setenv("HTTP_USER_AGENT", agent, 0);
|
setenv("HTTP_USER_AGENT", agent, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user