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:
		| @@ -9,7 +9,8 @@ use std::io::net::tcp::TcpStream; | ||||
| use {HttpResult}; | ||||
| use version::{HttpVersion}; | ||||
| use method; | ||||
| use header::{Headers, ContentLength}; | ||||
| use header::Headers; | ||||
| use header::common::ContentLength; | ||||
| use rfc7230::{read_request_line}; | ||||
| use rfc7230::{HttpReader, SizedReader, ChunkedReader}; | ||||
| use uri::RequestUri; | ||||
|   | ||||
| @@ -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