From e7f18d64686e2b94fe9ecba8106ca2ff5bdfe7f3 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Sun, 11 Apr 2021 14:09:10 +0200 Subject: feat: blob URL support in fetch (#10120) This commit adds blob URL support in `fetch`. Tested via WPT. This is the first op_crate to have a rust dependency on a different op_crate. --- op_crates/file/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'op_crates/file/lib.rs') diff --git a/op_crates/file/lib.rs b/op_crates/file/lib.rs index e8c2cde1d..ea519046f 100644 --- a/op_crates/file/lib.rs +++ b/op_crates/file/lib.rs @@ -24,9 +24,10 @@ pub struct Location(pub Url); pub struct BlobUrlStore(Arc>>); impl BlobUrlStore { - pub fn get(&self, url: &ModuleSpecifier) -> Result, AnyError> { + pub fn get(&self, mut url: Url) -> Result, AnyError> { let blob_store = self.0.lock().unwrap(); - Ok(blob_store.get(url).cloned()) + url.set_fragment(None); + Ok(blob_store.get(&url).cloned()) } pub fn insert(&self, blob: Blob, maybe_location: Option) -> Url { -- cgit v1.2.3