chore: upgrade crates (#11894)

Co-authored-by: David Sherret <dsherret@gmail.com>
This commit is contained in:
Bartek Iwańczuk 2021-09-02 17:38:19 +02:00 committed by GitHub
parent 77ead8af20
commit c84532b6d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 268 additions and 197 deletions

View file

@ -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());