Skip to content

Commit

Permalink
Fallback to default user agent if HTTP_USER_AGENT is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Kortkamp authored and bapt committed Jan 26, 2016
1 parent 7ced9c2 commit 2198138
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libpkg/pkg_config.c
Expand Up @@ -1108,6 +1108,8 @@ pkg_ini(const char *path, const char *reposdir, pkg_init_flags flags)
useragent = pkg_object_string(pkg_config_get("HTTP_USER_AGENT"));
if (useragent != NULL)
setenv("HTTP_USER_AGENT", useragent, 1);
else
setenv("HTTP_USER_AGENT", "pkg/"PKGVERSION, 1);

/* load the repositories */
load_repositories(reposdir, flags);
Expand Down

0 comments on commit 2198138

Please sign in to comment.