Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

Commit 2501e48

Browse files
committed
Ignore carraige returns in headers
Signed-off-by: Matt Butcher <matt.butcher@fermyon.com>
1 parent 5e8a7b7 commit 2501e48

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/handlers.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ pub fn compose_response(stdout_mutex: Arc<RwLock<Vec<u8>>>) -> Result<Response<B
156156
let mut buffer: Vec<u8> = Vec::new();
157157
let mut out_headers: Vec<u8> = Vec::new();
158158
out.iter().for_each(|i| {
159-
if scan_headers && *i == 10 && last == 10 {
159+
// Ignore CR in headers
160+
if *i == 13 {
161+
return;
162+
} else if scan_headers && *i == 10 && last == 10 {
160163
out_headers.append(&mut buffer);
161164
buffer = Vec::new();
162165
scan_headers = false;

0 commit comments

Comments
 (0)