fix(developer/read_image): send a User-Agent on URL image fetches (#9927)
This commit is contained in:
@@ -180,6 +180,11 @@ async fn load_image_bytes(source: &str, working_dir: Option<&Path>) -> Result<Ve
|
||||
|
||||
async fn load_url_bytes(url: url::Url) -> Result<Vec<u8>, String> {
|
||||
let client = reqwest::Client::builder()
|
||||
.user_agent(concat!(
|
||||
"goose/",
|
||||
env!("CARGO_PKG_VERSION"),
|
||||
" (+https://github.com/aaif-goose/goose)"
|
||||
))
|
||||
.timeout(Duration::from_secs(30))
|
||||
.build()
|
||||
.map_err(|error| format!("failed to create HTTP client: {error}"))?;
|
||||
|
||||
Reference in New Issue
Block a user