Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions crates/client/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,20 +230,23 @@ impl Client {

let res = self.client.get(url).send().await?;

if res.status().is_success() {
if let Some(warg_url) = res
.json::<WellKnownConfig>()
.await
.map_err(|_| {
ClientError::InvalidWellKnownConfig(self.url.registry_domain().to_string())
})?
.warg_url
{
Ok(Some(RegistryUrl::new(warg_url)?))
} else {
Ok(None)
}
if !res.status().is_success() {
tracing::debug!("the `.well-known` config was not found");
return Ok(None);
}

if let Some(warg_url) = res
.json::<WellKnownConfig>()
.await
.map_err(|e| {
tracing::debug!("parsing `.well-known` config failed: {e}");
ClientError::InvalidWellKnownConfig(self.url.registry_domain().to_string())
})?
.warg_url
{
Ok(Some(RegistryUrl::new(warg_url)?))
} else {
tracing::debug!("the `.well-known` config did not have a `wargUrl` set");
Ok(None)
}
}
Expand Down