summaryrefslogtreecommitdiff
path: root/spider/src/response.rs
diff options
context:
space:
mode:
Diffstat (limited to 'spider/src/response.rs')
-rw-r--r--spider/src/response.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/spider/src/response.rs b/spider/src/response.rs
index e192b22..35b2f00 100644
--- a/spider/src/response.rs
+++ b/spider/src/response.rs
@@ -1,6 +1,8 @@
use std::collections::HashMap;
use std::fmt;
+// TODO(andrew): add more flexible status structure.
+// (Possibly with enum variants?)
pub struct Response {
status: i32,
headers: HashMap<String, String>,
@@ -18,13 +20,10 @@ impl Response {
}
pub fn format<'a>(&self) -> &'a [u8] {
+ // TODO(andrew): replace placeholder response with actual
+ // formatted response;
let s = "HTTP/1.1 200 OK\r\nConnection: keep-alive\r\nContent-Type: text/html\r\n\r\n<i>Hello</i>";
return s.as_bytes();
-
- // let buf: &[u8];
- // buf = &[0; 1024];
-//
- // return buf;
}
}