mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
Check validity of the URL setting
This commit is contained in:
parent
a1db342f01
commit
dfa5e41ea6
6 changed files with 14 additions and 0 deletions
|
@ -1199,6 +1199,14 @@ pub fn validate_embedding_settings(
|
|||
.into());
|
||||
}
|
||||
|
||||
if let Some(url) = url.as_ref().set() {
|
||||
url::Url::parse(url).map_err(|error| crate::error::UserError::InvalidUrl {
|
||||
embedder_name: name.to_owned(),
|
||||
inner_error: error,
|
||||
url: url.to_owned(),
|
||||
})?;
|
||||
}
|
||||
|
||||
let Some(inferred_source) = source.set() else {
|
||||
return Ok(Setting::Set(EmbeddingSettings {
|
||||
source,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue