From e354efbb443d07d83d2244a034613f6dcdc17c45 Mon Sep 17 00:00:00 2001 From: jcamiel Date: Wed, 18 May 2022 11:29:19 +0200 Subject: [PATCH] Update comments. --- packages/hurl/src/main.rs | 6 ++++-- packages/hurl/src/runner/entry.rs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/hurl/src/main.rs b/packages/hurl/src/main.rs index a86b6a6dcc5..3fa9752c74d 100644 --- a/packages/hurl/src/main.rs +++ b/packages/hurl/src/main.rs @@ -339,11 +339,13 @@ fn main() { && hurl_result.errors().is_empty() && !cli_options.interactive { - // default - // last entry + response + body + // By default, we output the body response bytes of the last entry if let Some(entry_result) = hurl_result.entries.last() { if let Some(response) = entry_result.response.clone() { let mut output = vec![]; + + // If include options is set, we output the HTTP response headers + // with status and version (to mimic curl outputs) if cli_options.include { let status_line = format!("HTTP/{} {}\n", response.version, response.status); diff --git a/packages/hurl/src/runner/entry.rs b/packages/hurl/src/runner/entry.rs index 22e13bf5c28..b79f0f882d1 100644 --- a/packages/hurl/src/runner/entry.rs +++ b/packages/hurl/src/runner/entry.rs @@ -139,7 +139,7 @@ pub fn run( let mut errors = vec![]; let time_in_ms = http_response.duration.as_millis(); - // Last call + // We runs capture and asserts on the last HTTP request/response chains. if i == calls.len() - 1 { captures = match entry.response.clone() { None => vec![],