SIGN IN SIGN UP
Homebrew / brew UNCLAIMED

🍺 The missing package manager for macOS (or Linux)

0 0 185 Ruby

brew-rs: set reqwest user agent

`brew.sh` sets various user agents, like `HOMEBREW_USER_AGENT_CURL`
used by curl. This consists of the `HOMEBREW_USER_AGENT` string with
the curl version appended (e.g., "Homebrew/5.1.1-73-gb54c872
(Macintosh; arm64 Mac OS X 26.4) curl/8.7.1"). `reqwest` doesn't seem
to set a user agent by default, so this modifies the `build_client`
function to create a similar user agent string by appending the
brew-rs version (like "brew-rs/0.1.0") after `HOMEBREW_USER_AGENT`.
The environment variable should always be present when executed by
`brew` but this will simply fall back to the brew-rs version string if
`HOMEBREW_USER_AGENT` isn't available.
S
Sam Ford committed
8023625d9c5a4dd077dacdbd451d8f3817b765b5
Parent: 88e699b