diff --git a/tvix/castore/src/directoryservice/combinators.rs b/tvix/castore/src/directoryservice/combinators.rs index 428314223..84216de92 100644 --- a/tvix/castore/src/directoryservice/combinators.rs +++ b/tvix/castore/src/directoryservice/combinators.rs @@ -152,11 +152,12 @@ pub struct CacheConfig { impl TryFrom for CacheConfig { type Error = Box; - fn try_from(_url: url::Url) -> Result { - Err(Error::StorageError( - "Instantiating a CombinedDirectoryService from a url is not supported".into(), - ) - .into()) + fn try_from(url: url::Url) -> Result { + // cache doesn't support host or path in the URL. + if url.has_host() || !url.path().is_empty() { + return Err(Error::StorageError("invalid url".to_string()).into()); + } + Ok(serde_qs::from_str(url.query().unwrap_or_default())?) } }