Skip to content

Commit

Permalink
Add 'Repeated-Header' to the original headers
Browse files Browse the repository at this point in the history
  • Loading branch information
theoforger committed Dec 6, 2024
1 parent 31a0bbf commit 397fb46
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/hurl/src/http/headers_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,13 @@ mod tests {
fn aggregate_raw_headers() {
let mut headers = HeaderVec::new();
headers.push(Header::new("Host", "localhost:8000"));
headers.push(Header::new("Repeated-Header", "original"));

let raw_headers = &[
"User-Agent: hurl/6.1.0",
"Invalid-Header",
"Repeated-Header: content-1",
"Repeated-Header: content-2",
"Repeated-Header: aggregated-1",
"Repeated-Header: aggregated-2",
];
let aggregated = headers.aggregate_raw_headers(raw_headers);

Expand All @@ -144,8 +145,9 @@ mod tests {
assert_eq!(
aggregated.get_all("Repeated-Header"),
vec![
&Header::new("Repeated-Header", "content-1"),
&Header::new("Repeated-Header", "content-2")
&Header::new("Repeated-Header", "original"),
&Header::new("Repeated-Header", "aggregated-1"),
&Header::new("Repeated-Header", "aggregated-2")
]
);
}
Expand Down

0 comments on commit 397fb46

Please sign in to comment.