diff options
| author | Andrew <saintruler@gmail.com> | 2021-02-14 14:38:03 +0400 |
|---|---|---|
| committer | Andrew <saintruler@gmail.com> | 2021-02-14 14:38:03 +0400 |
| commit | ad92fb3dc6a3350b7b8952be40c5c3a7aa543892 (patch) | |
| tree | 24a11fc60e0922aa93ac2dfdece99b2e8dc36a10 /spider/src/response.rs | |
| parent | 053534d753439fcf47168f3515a03478d384be87 (diff) | |
Added more TODOs
Diffstat (limited to 'spider/src/response.rs')
| -rw-r--r-- | spider/src/response.rs | 9 |
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; } } |