Skip to content
⌘K
Explore
Download
Docs
Sign in
Sign up
flagon-io
/
g1t
public
Star
0
Overview
Code
Issues
Pull requests
Workflows
Deployments
Insights
Files
Commits
Branches
Tags
Releases
Compare
Commit
The runner's broker test reads the relayed answer's body as chunks: the proxy passes the body on as it reads it, so "got " and "hello" can arrive as two chunks, and looking for "got hello" in the raw bytes failed CI #166 on a correct answer.
syntaqx
committed
4h ago
Parent
75c6704
Browse files
85c083a0e4e4
1
file
+4
−1
0/1 viewed
Collapse all
Unified
Split
crates/runner/src/actions/broker.rs
+4
−1
View
Blame
Viewed
1026
1026
let answer = read_all(&mut tls);
1027
1027
assert!(answer.starts_with("HTTP/1.1 201 Created\r\n"), "{answer}");
1028
1028
assert!(answer.contains("x-from: upstream\r\n") && answer.contains("transfer-encoding: chunked"), "{answer}");
1029
−
assert!(answer.contains("got hello"), "{answer}");
1029
+
// The body may come in more than one chunk, so it is read as chunks.
1030
+
let mut chunks = BufReader::new(answer.as_bytes());
1031
+
let head = read_head(&mut chunks).unwrap().unwrap();
1032
+
assert_eq!(read_body(&mut chunks, &head).unwrap(), b"got hello", "{answer}");
1030
1033
1031
1034
let (headers, body) = heard.recv().unwrap();
1032
1035
assert_eq!(body, b"hello");