From 8388afc9d909daa25ff725f22deb10345eaa9a10 Mon Sep 17 00:00:00 2001 From: Ryan Blecher Date: Mon, 21 Sep 2020 23:26:20 -0400 Subject: [PATCH] add support for the text/csv content-type (#2587) --- crates/nu_plugin_fetch/src/fetch.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/nu_plugin_fetch/src/fetch.rs b/crates/nu_plugin_fetch/src/fetch.rs index c384c24229..1cd45c0539 100644 --- a/crates/nu_plugin_fetch/src/fetch.rs +++ b/crates/nu_plugin_fetch/src/fetch.rs @@ -190,6 +190,15 @@ async fn helper( ) .into_value(tag), )), + (mime::TEXT, mime::CSV) => Ok(( + Some("csv".to_string()), + UntaggedValue::string( + r.body_string() + .await + .map_err(|e| generate_error("text", e, &span))?, + ) + .into_value(tag), + )), (mime::TEXT, mime::PLAIN) => { let path_extension = url::Url::parse(location) .map_err(|_| {