summaryrefslogtreecommitdiff
path: root/cli/file_fetcher.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2021-09-02 17:38:19 +0200
committerGitHub <noreply@github.com>2021-09-02 17:38:19 +0200
commitc84532b6d5a424694c519260f0cf407b1d8ba604 (patch)
treeb0cd78f2f851ceb8b8b92fc146e8e5d29b263505 /cli/file_fetcher.rs
parent77ead8af20180453aa2d0db67d7856641bd5498f (diff)
chore: upgrade crates (#11894)
Co-authored-by: David Sherret <dsherret@gmail.com>
Diffstat (limited to 'cli/file_fetcher.rs')
-rw-r--r--cli/file_fetcher.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/cli/file_fetcher.rs b/cli/file_fetcher.rs
index a1729825f..17bbb76f0 100644
--- a/cli/file_fetcher.rs
+++ b/cli/file_fetcher.rs
@@ -56,6 +56,8 @@ pub struct File {
/// The _final_ specifier for the file. The requested specifier and the final
/// specifier maybe different for remote files that have been redirected.
pub specifier: ModuleSpecifier,
+
+ pub maybe_headers: Option<HashMap<String, String>>,
}
/// Simple struct implementing in-process caching to prevent multiple
@@ -137,6 +139,7 @@ fn fetch_local(specifier: &ModuleSpecifier) -> Result<File, AnyError> {
media_type,
source,
specifier: specifier.clone(),
+ maybe_headers: None,
})
}
@@ -274,6 +277,7 @@ impl FileFetcher {
media_type,
source,
specifier: specifier.clone(),
+ maybe_headers: Some(headers.clone()),
})
}
@@ -365,6 +369,7 @@ impl FileFetcher {
media_type,
source,
specifier: specifier.clone(),
+ maybe_headers: None,
})
}
@@ -426,6 +431,7 @@ impl FileFetcher {
media_type,
source,
specifier: specifier.clone(),
+ maybe_headers: None,
})
}
/// Asynchronously fetch remote source file specified by the URL following
@@ -894,6 +900,7 @@ mod tests {
media_type: MediaType::TypeScript,
source: "some source code".to_string(),
specifier: specifier.clone(),
+ maybe_headers: None,
};
file_fetcher.insert_cached(file.clone());