property treat header names as case insensitive

This commit is contained in:
Sean McArthur
2014-09-23 09:02:58 -07:00
parent 11d8b12fa3
commit 0191bff43a
10 changed files with 66 additions and 22 deletions

View File

@@ -22,7 +22,7 @@ pub struct Accept(pub Vec<Mime>);
impl Header for Accept {
fn header_name(_: Option<Accept>) -> &'static str {
"accept"
"Accept"
}
fn parse_header(_raw: &[Vec<u8>]) -> Option<Accept> {

View File

@@ -28,7 +28,7 @@ impl FromStr for Connection {
impl Header for Connection {
fn header_name(_: Option<Connection>) -> &'static str {
"connection"
"Connection"
}
fn parse_header(raw: &[Vec<u8>]) -> Option<Connection> {

View File

@@ -11,7 +11,7 @@ pub struct ContentLength(pub uint);
impl Header for ContentLength {
fn header_name(_: Option<ContentLength>) -> &'static str {
"content-length"
"Content-Length"
}
fn parse_header(raw: &[Vec<u8>]) -> Option<ContentLength> {

View File

@@ -12,7 +12,7 @@ pub struct ContentType(pub Mime);
impl Header for ContentType {
fn header_name(_: Option<ContentType>) -> &'static str {
"content-type"
"Content-Type"
}
fn parse_header(raw: &[Vec<u8>]) -> Option<ContentType> {

View File

@@ -11,7 +11,7 @@ pub struct Date(pub Tm);
impl Header for Date {
fn header_name(_: Option<Date>) -> &'static str {
"date"
"Date"
}
fn parse_header(raw: &[Vec<u8>]) -> Option<Date> {

View File

@@ -14,7 +14,7 @@ pub struct Host(pub String);
impl Header for Host {
fn header_name(_: Option<Host>) -> &'static str {
"host"
"Host"
}
fn parse_header(raw: &[Vec<u8>]) -> Option<Host> {

View File

@@ -10,7 +10,7 @@ pub struct Server(pub String);
impl Header for Server {
fn header_name(_: Option<Server>) -> &'static str {
"server"
"Server"
}
fn parse_header(raw: &[Vec<u8>]) -> Option<Server> {

View File

@@ -57,7 +57,7 @@ impl FromStr for Encoding {
impl Header for TransferEncoding {
fn header_name(_: Option<TransferEncoding>) -> &'static str {
"transfer-encoding"
"Transfer-Encoding"
}
fn parse_header(raw: &[Vec<u8>]) -> Option<TransferEncoding> {

View File

@@ -10,7 +10,7 @@ pub struct UserAgent(pub String);
impl Header for UserAgent {
fn header_name(_: Option<UserAgent>) -> &'static str {
"user-agent"
"User-Agent"
}
fn parse_header(raw: &[Vec<u8>]) -> Option<UserAgent> {