lemmy/crates/apub_lib/src/verify.rs

18 lines
379 B
Rust
Raw Normal View History

use activitystreams::error::DomainError;
use lemmy_utils::LemmyError;
use url::Url;
pub fn verify_domains_match(a: &Url, b: &Url) -> Result<(), LemmyError> {
if a.domain() != b.domain() {
return Err(DomainError.into());
}
Ok(())
}
pub fn verify_urls_match(a: &Url, b: &Url) -> Result<(), LemmyError> {
if a != b {
return Err(DomainError.into());
}
Ok(())
}