feat: support import attributes (#20342)

This commit is contained in:
David Sherret 2023-09-07 08:09:16 -05:00 committed by GitHub
parent 01a761f1d4
commit 3fc19dab47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
61 changed files with 434 additions and 225 deletions

View file

@ -15,6 +15,7 @@ use super::path_to_regex::Token;
use crate::args::CacheSetting;
use crate::cache::GlobalHttpCache;
use crate::cache::HttpCache;
use crate::file_fetcher::FetchOptions;
use crate::file_fetcher::FileFetcher;
use crate::http_util::HttpClient;
@ -509,11 +510,12 @@ impl ModuleRegistry {
) -> Result<Vec<RegistryConfiguration>, AnyError> {
let fetch_result = self
.file_fetcher
.fetch_with_accept(
.fetch_with_options(FetchOptions {
specifier,
PermissionsContainer::allow_all(),
Some("application/vnd.deno.reg.v2+json, application/vnd.deno.reg.v1+json;q=0.9, application/json;q=0.8"),
)
permissions: PermissionsContainer::allow_all(),
maybe_accept: Some("application/vnd.deno.reg.v2+json, application/vnd.deno.reg.v1+json;q=0.9, application/json;q=0.8"),
maybe_cache_setting: None,
})
.await;
// if there is an error fetching, we will cache an empty file, so that
// subsequent requests they are just an empty doc which will error without