Skip to content

Commit 117e8fc

Browse files
committed
Fix some tests
1 parent 925bdbf commit 117e8fc

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/src/store.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ pub struct Store {
1515
default_agent: Arc<Mutex<Option<crate::agents::Agent>>>,
1616
}
1717

18+
/// The URL used for stores that are not accessible on the web.
19+
pub const LOCAL_STORE_URL_STR: &str = "local:store";
20+
1821
lazy_static::lazy_static! {
19-
static ref LOCAL_STORE_URL: Url = Url::parse("local:store").unwrap();
22+
static ref LOCAL_STORE_URL: Url = Url::parse(LOCAL_STORE_URL_STR).unwrap();
2023
}
2124

2225
impl Store {

lib/src/storelike.rs

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use crate::{
88
errors::AtomicError,
99
hierarchy,
1010
schema::{Class, Property},
11+
store::LOCAL_STORE_URL_STR,
1112
urls,
1213
};
1314
use crate::{errors::AtomicResult, parse::parse_json_ad_string};
@@ -227,6 +228,9 @@ pub trait Storelike: Sized {
227228
/// the answer should always be `true`.
228229
fn is_external_subject(&self, subject: &str) -> AtomicResult<bool> {
229230
if let Some(self_url) = self.get_self_url() {
231+
if self_url.as_str() == LOCAL_STORE_URL_STR {
232+
return Ok(true);
233+
}
230234
if subject.starts_with(&self_url.as_str()) {
231235
return Ok(false);
232236
} else {

0 commit comments

Comments
 (0)