summaryrefslogtreecommitdiff
path: root/cli/http_util.rs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2020-05-09 12:43:24 -0400
committerGitHub <noreply@github.com>2020-05-09 12:43:24 -0400
commiteb505f8afcd56f4d4a372cdfbb66906d8a5107c7 (patch)
tree718699a111998ffc4190db318c3038e34771fd86 /cli/http_util.rs
parentd5dd5ae87d7598643a46f27fa4a11b2a85d42be8 (diff)
Add support for X-Deno-Warning header (#5161)
Diffstat (limited to 'cli/http_util.rs')
-rw-r--r--cli/http_util.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/cli/http_util.rs b/cli/http_util.rs
index 12e70e3e7..2278afc8d 100644
--- a/cli/http_util.rs
+++ b/cli/http_util.rs
@@ -117,6 +117,15 @@ pub fn fetch_once(
let mut headers_: HashMap<String, String> = HashMap::new();
let headers = response.headers();
+
+ if let Some(warning) = headers.get("X-Deno-Warning") {
+ eprintln!(
+ "{} {}",
+ crate::colors::yellow("Warning".to_string()),
+ warning.to_str().unwrap()
+ );
+ }
+
for key in headers.keys() {
let key_str = key.to_string();
let values = headers.get_all(key);