about summary refs log tree commit diff
path: root/tvix/castore/src/directoryservice/from_addr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/castore/src/directoryservice/from_addr.rs')
-rw-r--r--tvix/castore/src/directoryservice/from_addr.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/tvix/castore/src/directoryservice/from_addr.rs b/tvix/castore/src/directoryservice/from_addr.rs
index 9aa01df171d7..999170dcd13f 100644
--- a/tvix/castore/src/directoryservice/from_addr.rs
+++ b/tvix/castore/src/directoryservice/from_addr.rs
@@ -75,10 +75,13 @@ pub async fn from_addr(uri: &str) -> Result<Box<dyn DirectoryService>, crate::Er
             // parse it back as url, as Url::set_scheme() rejects some of the transitions we want to do.
             let trimmed_url = {
                 let s = url.to_string();
-                Url::parse(s.strip_prefix("objectstore+").unwrap()).unwrap()
+                let mut url = Url::parse(s.strip_prefix("objectstore+").unwrap()).unwrap();
+                // trim the query pairs, they might contain credentials or local settings we don't want to send as-is.
+                url.set_query(None);
+                url
             };
             Box::new(
-                ObjectStoreDirectoryService::parse_url(&trimmed_url)
+                ObjectStoreDirectoryService::parse_url_opts(&trimmed_url, url.query_pairs())
                     .map_err(|e| Error::StorageError(e.to_string()))?,
             )
         }