aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTeddy Wing2020-06-28 19:54:01 +0200
committerTeddy Wing2020-06-28 19:54:01 +0200
commit8ac4bfa0c941acefedf0d384685e8b422fc4b426 (patch)
treedf7b4b615a9efd095c4b2bb7e4d1ce1340ebbc97 /src
parenta613320c5f69089feba14ef36de58bdc21dd7e0b (diff)
downloadfastcgi-conduit-8ac4bfa0c941acefedf0d384685e8b422fc4b426.tar.bz2
Server::start(): Write HTTP version and status code
Diffstat (limited to 'src')
-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();