diff --git a/lib/src/store.rs b/lib/src/store.rs index e07c27d14..46d899224 100644 --- a/lib/src/store.rs +++ b/lib/src/store.rs @@ -18,8 +18,11 @@ pub struct Store { default_agent: Arc>>, } +/// The URL used for stores that are not accessible on the web. +pub const LOCAL_STORE_URL_STR: &str = "local:store"; + lazy_static::lazy_static! { - static ref LOCAL_STORE_URL: Url = Url::parse("local:store").unwrap(); + static ref LOCAL_STORE_URL: Url = Url::parse(LOCAL_STORE_URL_STR).unwrap(); } impl Store { diff --git a/lib/src/storelike.rs b/lib/src/storelike.rs index f461839a8..29f6bb8a1 100644 --- a/lib/src/storelike.rs +++ b/lib/src/storelike.rs @@ -8,6 +8,7 @@ use crate::{ errors::AtomicError, hierarchy, schema::{Class, Property}, + store::LOCAL_STORE_URL_STR, values::query_value_compare, }; use crate::{errors::AtomicResult, parse::parse_json_ad_string}; @@ -223,6 +224,9 @@ pub trait Storelike: Sized { /// the answer should always be `true`. fn is_external_subject(&self, subject: &str) -> AtomicResult { if let Some(self_url) = self.get_self_url() { + if self_url.as_str() == LOCAL_STORE_URL_STR { + return Ok(true); + } if subject.starts_with(&self_url.as_str()) { return Ok(false); } else {