summaryrefslogtreecommitdiff
path: root/cli/ops/fetch.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2019-12-31 15:09:58 +0100
committerGitHub <noreply@github.com>2019-12-31 15:09:58 +0100
commit4258ed262f6eed9b0ee123e1ba9c91f999f0b429 (patch)
tree0136ceed29436bbbf499971c74b57ac722d3958d /cli/ops/fetch.rs
parent05dce9016500f8cb102acb7ad68c184aa1047dae (diff)
refactor: move HttpBody to cli/http_util.rs (#3569)
Diffstat (limited to 'cli/ops/fetch.rs')
-rw-r--r--cli/ops/fetch.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/cli/ops/fetch.rs b/cli/ops/fetch.rs
index 9db8d68be..2787b5b7f 100644
--- a/cli/ops/fetch.rs
+++ b/cli/ops/fetch.rs
@@ -1,13 +1,11 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
use super::dispatch_json::{Deserialize, JsonOp, Value};
use super::io::StreamResource;
-use crate::http_body::HttpBody;
-use crate::http_util::get_client;
+use crate::http_util::{get_client, HttpBody};
use crate::ops::json_op;
use crate::state::ThreadSafeState;
use deno::*;
use futures::future::FutureExt;
-use futures::StreamExt;
use http::header::HeaderName;
use http::header::HeaderValue;
use http::Method;
@@ -66,7 +64,7 @@ pub fn op_fetch(
res_headers.push((key.to_string(), val.to_str().unwrap().to_owned()));
}
- let body = HttpBody::from(res.bytes_stream().boxed());
+ let body = HttpBody::from(res);
let mut table = state_.lock_resource_table();
let rid = table.add(
"httpBody",