Skip to content

Commit 457c269

Browse files
committed
Double check we can use network
1 parent 2c2320b commit 457c269

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

profile-googlefonts/src/network_conditions.rs

+6
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ pub(crate) fn production_metadata(context: &Context) -> Result<Map<String, Value
3636
#[allow(dead_code)]
3737
pub(crate) fn is_listed_on_google_fonts(family: &str, context: &Context) -> Result<bool, String> {
3838
// println!("Looking for family {}", family);
39+
if context.skip_network {
40+
return Err("Network access disabled".to_string());
41+
}
3942
let key = format!("is_listed_on_google_fonts:{}", family);
4043
context.cached_question(
4144
&key,
@@ -71,6 +74,9 @@ pub(crate) fn remote_styles(family: &str, context: &Context) -> Result<Vec<Testa
7174
#[cfg(not(target_family = "wasm"))]
7275
fn remote_styles_impl(family: &str, context: &Context) -> Result<Vec<Testable>, String> {
7376
let key = format!("remote_styles:{}", family);
77+
if context.skip_network {
78+
return Err("Network access disabled".to_string());
79+
}
7480
context.cached_question(
7581
&key,
7682
|| {

0 commit comments

Comments
 (0)