Skip to content

Commit 26468b4

Browse files
committed
Fix content_type in fetch_sync_string()
1 parent b9914c3 commit 26468b4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/http_util.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ pub fn fetch_sync_string(module_name: &str) -> DenoResult<(String, String)> {
7575
.map_err(|err| DenoError::from(err));
7676
body.join(future::ok(content_type))
7777
}).and_then(|(body_string, maybe_content_type)| {
78-
future::ok((body_string, maybe_content_type.unwrap()))
78+
let ct = match maybe_content_type {
79+
Some(s) => s,
80+
None => String::from(""),
81+
};
82+
future::ok((body_string, ct))
7983
});
8084

8185
tokio_util::block_on(fetch_future)

0 commit comments

Comments
 (0)