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

Commit a5b3e7b

Browse files
authored
Merge pull request #172 from technosophos/fix/171-carriage-return
Ignore carriage returns in headers
2 parents 5e8a7b7 + 2501e48 commit a5b3e7b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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)