Split common headers into a submodule and into their own files
This is a more extensible place to put them and doesn't clutter up header/mod.rs as much as the old scheme did. Fixes #8
This commit is contained in:
@@ -8,6 +8,7 @@ use std::io::net::tcp::TcpStream;
|
||||
use time::now_utc;
|
||||
|
||||
use header;
|
||||
use header::common;
|
||||
use status;
|
||||
use version;
|
||||
use rfc7230::{CR, LF, LINE_ENDING};
|
||||
@@ -48,8 +49,8 @@ impl Response {
|
||||
debug!("writing head: {} {}", self.version, self.status);
|
||||
try!(write!(self.body, "{} {}{}{}", self.version, self.status, CR as char, LF as char));
|
||||
|
||||
if !self.headers.has::<header::Date>() {
|
||||
self.headers.set(header::Date(now_utc()));
|
||||
if !self.headers.has::<common::Date>() {
|
||||
self.headers.set(common::Date(now_utc()));
|
||||
}
|
||||
|
||||
for (name, header) in self.headers.iter() {
|
||||
|
||||
Reference in New Issue
Block a user