registry: Set user agent when authenticating with github

This commit is contained in:
kpcyrd
2021-06-23 16:22:31 +02:00
parent 84e0e62753
commit 699ebad23a

View File

@@ -5,6 +5,7 @@ pub fn get_username(oauth_token: &str) -> Result<String> {
let client = reqwest::Client::new();
let mut resp = client.get("https://api.github.com/user")
.header("Authorization", format!("token {}", oauth_token))
.header("User-Agent", "sn0int-registry")
.send()
.context("Failed to check access_token")?
.error_for_status()