aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 5d26a98..558460f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -253,6 +253,13 @@ impl Server {
let (head, body) = response.unwrap().into_parts();
+ write!(
+ &mut stdout,
+ "HTTP/1.1 {} {}\r\n",
+ head.status.as_str(),
+ head.status.canonical_reason().unwrap_or("UNKNOWN"),
+ );
+
for (name, value) in head.headers.iter() {
write!(&mut stdout, "{}: ", name).unwrap();
stdout.write(value.as_bytes()).unwrap();