Add User-Agent to requests
Modrinth strongly encourages (via the following response header) that access to their services be done with a uniquely identifying user-agent string. > "x-user-agent-notice": "!!!!! Hey, you! Yes, **you**! You need to > change your User-Agent ASAP or you may be blocked from using > Modrinth's services! For more information see the documentation: > https://docs.modrinth.com/api-spec/#section/User-Agents !!!!!" The one added here follows the documentation recommendation for the "best" example of a user-agent string.
This commit is contained in:
parent
74de0d15b3
commit
9064888265
|
@ -14,7 +14,10 @@ impl HopperClient {
|
|||
pub fn new(config: Config) -> Self {
|
||||
Self {
|
||||
config: config,
|
||||
client: reqwest::Client::new(),
|
||||
client: reqwest::ClientBuilder::new()
|
||||
.user_agent(format!("tebibytemedia/hopper/{} (tebibyte.media)", env!("CARGO_PKG_VERSION")))
|
||||
.build()
|
||||
.unwrap(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue