Closed vszakats closed 4 years ago
Wouldn't it be simpler/more robust to add "-A curl" to CURL_OPTIONS ? (like -L is added).
@popcornmix It'd be simpler, but the current patch respects user's default choice better by leaving user-agent to the default value in curl
calls where any/no user-agent works equally well.
How about a new options variable? e.g.
CURL_OPTIONS_API=${CURL_OPTIONS_API:-"-A curl"}
and add that to just the api calls that need it?
Sounds good!
I've updated the patch.
Thanks!
This makes the updater work in environments where user agent is disabled via
.curlrc
(or similar means), and whererpi-update
would otherwise run into anInvalid hash given
error.Ref: https://developer.github.com/v3/#user-agent-required