mirror of
https://github.com/0xMassi/webclaw.git
synced 2026-06-19 01:58:06 +02:00
fix: harden fetch URL validation
This commit is contained in:
parent
23544f8fac
commit
bdf81fe6bf
10 changed files with 284 additions and 27 deletions
|
|
@ -70,7 +70,12 @@ impl IntoResponse for ApiError {
|
|||
|
||||
impl From<webclaw_fetch::FetchError> for ApiError {
|
||||
fn from(e: webclaw_fetch::FetchError) -> Self {
|
||||
Self::Fetch(e.to_string())
|
||||
match e {
|
||||
webclaw_fetch::FetchError::InvalidUrl(msg) => {
|
||||
Self::BadRequest(format!("invalid url: {msg}"))
|
||||
}
|
||||
other => Self::Fetch(other.to_string()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue