From ff0774eb724ee4428b37054513ffb3f7da9f6ea3 Mon Sep 17 00:00:00 2001 From: Joep Meindertsma Date: Wed, 28 Sep 2022 22:22:13 +0200 Subject: [PATCH] Fix some tests --- lib/src/store.rs | 5 ++++- lib/src/storelike.rs | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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 {