Merge pull request #534 from matthiasbeyer/libimagentrylink/tmp-fix-external-link-checking

Temporary fix: Check whether an StoreId is an external link by str::c…
This commit is contained in:
Matthias Beyer 2016-07-15 11:21:44 +02:00 committed by GitHub
commit 6f07359416

View file

@ -90,7 +90,7 @@ pub trait ExternalLinker : InternalLinker {
/// Check whether the StoreId starts with `/link/external/` /// Check whether the StoreId starts with `/link/external/`
pub fn is_external_link_storeid(id: &StoreId) -> bool { pub fn is_external_link_storeid(id: &StoreId) -> bool {
debug!("Checking whether this is a /link/external/*: '{:?}'", id); debug!("Checking whether this is a /link/external/*: '{:?}'", id);
id.starts_with("/link/external/") id.parent().map(|par| par.ends_with("/link/external")).unwrap_or(false)
} }
fn get_external_link_from_file(entry: &FileLockEntry) -> Result<Url> { fn get_external_link_from_file(entry: &FileLockEntry) -> Result<Url> {