Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Aug 30, 2018
1 parent 01a6267 commit 6b859a8
Show file tree
Hide file tree
Showing 44 changed files with 178 additions and 1,588 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target
/Cargo.lock
2 changes: 1 addition & 1 deletion src/common/accept.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ header! {
/// ])
/// );
/// ```
(Accept, "Accept") => (QualityItem<Mime>)+
(Accept, ACCEPT) => (QualityItem<Mime>)+

test_accept {
// Tests from the RFC
Expand Down
2 changes: 1 addition & 1 deletion src/common/accept_charset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ header! {
/// AcceptCharset(vec![qitem(Charset::Ext("utf-8".to_owned()))])
/// );
/// ```
(AcceptCharset, "Accept-Charset") => (QualityItem<Charset>)+
(AcceptCharset, ACCEPT_CHARSET) => (QualityItem<Charset>)+

test_accept_charset {
/// Testcase from RFC
Expand Down
2 changes: 1 addition & 1 deletion src/common/accept_encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ header! {
/// ])
/// );
/// ```
(AcceptEncoding, "Accept-Encoding") => (QualityItem<Encoding>)*
(AcceptEncoding, ACCEPT_ENCODING) => (QualityItem<Encoding>)*

test_accept_encoding {
// From the RFC
Expand Down
2 changes: 1 addition & 1 deletion src/common/accept_language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ header! {
/// );
/// # }
/// ```
(AcceptLanguage, "Accept-Language") => (QualityItem<LanguageTag>)+
(AcceptLanguage, ACCEPT_LANGUAGE) => (QualityItem<LanguageTag>)+

test_accept_language {
// From the RFC
Expand Down
2 changes: 1 addition & 1 deletion src/common/accept_ranges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ header! {
/// ])
/// );
/// ```
(AcceptRanges, "Accept-Ranges") => (RangeUnit)+
(AcceptRanges, ACCEPT_RANGES) => (RangeUnit)+

test_acccept_ranges {
test_header!(test1, vec![b"bytes"]);
Expand Down
2 changes: 1 addition & 1 deletion src/common/access_control_allow_headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ header! {
/// );
/// # }
/// ```
(AccessControlAllowHeaders, "Access-Control-Allow-Headers") => (Ascii<String>)*
(AccessControlAllowHeaders, ACCESS_CONTROL_ALLOW_HEADERS) => (Ascii<String>)*

test_access_control_allow_headers {
test_header!(test1, vec![b"accept-language, date"]);
Expand Down
2 changes: 1 addition & 1 deletion src/common/access_control_allow_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ header! {
/// ])
/// );
/// ```
(AccessControlAllowMethods, "Access-Control-Allow-Methods") => (Method)*
(AccessControlAllowMethods, ACCESS_CONTROL_ALLOW_METHODS) => (Method)*

test_access_control_allow_methods {
test_header!(test1, vec![b"PUT, DELETE, XMODIFY"]);
Expand Down
2 changes: 1 addition & 1 deletion src/common/access_control_expose_headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ header! {
/// );
/// # }
/// ```
(AccessControlExposeHeaders, "Access-Control-Expose-Headers") => (Ascii<String>)*
(AccessControlExposeHeaders, ACCESS_CONTROL_EXPOSE_HEADERS) => (Ascii<String>)*

test_access_control_expose_headers {
test_header!(test1, vec![b"etag, content-length"]);
Expand Down
2 changes: 1 addition & 1 deletion src/common/access_control_max_age.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ header! {
/// let mut headers = Headers::new();
/// headers.set(AccessControlMaxAge(1728000u32));
/// ```
(AccessControlMaxAge, "Access-Control-Max-Age") => [u32]
(AccessControlMaxAge, ACCESS_CONTROL_MAX_AGE) => [u32]

test_access_control_max_age {
test_header!(test1, vec![b"531"]);
Expand Down
2 changes: 1 addition & 1 deletion src/common/access_control_request_headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ header! {
/// );
/// # }
/// ```
(AccessControlRequestHeaders, "Access-Control-Request-Headers") => (Ascii<String>)*
(AccessControlRequestHeaders, ACCESS_CONTROL_REQUEST_HEADERS) => (Ascii<String>)*

test_access_control_request_headers {
test_header!(test1, vec![b"accept-language, date"]);
Expand Down
2 changes: 1 addition & 1 deletion src/common/access_control_request_method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ header! {
/// let mut headers = Headers::new();
/// headers.set(AccessControlRequestMethod(Method::GET));
/// ```
(AccessControlRequestMethod, "Access-Control-Request-Method") => [Method]
(AccessControlRequestMethod, ACCESS_CONTROL_REQUEST_METHOD) => [Method]

test_access_control_request_method {
test_header!(test1, vec![b"GET"]);
Expand Down
2 changes: 1 addition & 1 deletion src/common/allow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ header! {
/// ])
/// );
/// ```
(Allow, "Allow") => (Method)*
(Allow, ALLOW) => (Method)*

test_allow {
// From the RFC
Expand Down
2 changes: 1 addition & 1 deletion src/common/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ header! {
/// );
/// # }
/// ```
(Connection, "Connection") => (ConnectionOption)+
(Connection, CONNECTION) => (ConnectionOption)+

test_connection {
test_header!(test1, vec![b"close"]);
Expand Down
2 changes: 1 addition & 1 deletion src/common/content_encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ header! {
/// ])
/// );
/// ```
(ContentEncoding, "Content-Encoding") => (Encoding)+
(ContentEncoding, CONTENT_ENCODING) => (Encoding)+

test_content_encoding {
/// Testcase from the RFC
Expand Down
2 changes: 1 addition & 1 deletion src/common/content_language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ header! {
/// );
/// # }
/// ```
(ContentLanguage, "Content-Language") => (QualityItem<LanguageTag>)+
(ContentLanguage, CONTENT_LANGUAGE) => (QualityItem<LanguageTag>)+

test_content_language {
test_header!(test1, vec![b"da"]);
Expand Down
2 changes: 1 addition & 1 deletion src/common/content_location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ header! {
/// headers.set(ContentLocation("http://www.example.org/hypertext/Overview.html".to_owned()));
/// ```
// TODO: use URL
(ContentLocation, "Content-Location") => [String]
(ContentLocation, CONTENT_LOCATION) => [String]

test_content_location {
test_header!(partial_query, vec![b"/hypertext/Overview.html?q=tim"]);
Expand Down
2 changes: 1 addition & 1 deletion src/common/content_range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::str::FromStr;
header! {
/// `Content-Range` header, defined in
/// [RFC7233](http://tools.ietf.org/html/rfc7233#section-4.2)
(ContentRange, "Content-Range") => [ContentRangeSpec]
(ContentRange, CONTENT_RANGE) => [ContentRangeSpec]

test_content_range {
test_header!(test_bytes,
Expand Down
2 changes: 1 addition & 1 deletion src/common/content_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ header! {
/// ContentType(mime::TEXT_HTML)
/// );
/// ```
(ContentType, "Content-Type") => danger [Mime]
(ContentType, CONTENT_TYPE) => [Mime]

test_content_type {
test_header!(
Expand Down
2 changes: 1 addition & 1 deletion src/common/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ header! {
/// let mut headers = Headers::new();
/// headers.set(Date(SystemTime::now().into()));
/// ```
(Date, "Date") => [HttpDate]
(Date, DATE) => [HttpDate]

test_date {
test_header!(test1, vec![b"Tue, 15 Nov 1994 08:12:31 GMT"]);
Expand Down
2 changes: 1 addition & 1 deletion src/common/etag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ header! {
/// let mut headers = Headers::new();
/// headers.set(ETag(EntityTag::new(true, "xyzzy".to_owned())));
/// ```
(ETag, "ETag") => [EntityTag]
(ETag, ETAG) => [EntityTag]

test_etag {
// From the RFC
Expand Down
2 changes: 1 addition & 1 deletion src/common/expires.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ header! {
/// let expiration = SystemTime::now() + Duration::from_secs(60 * 60 * 24);
/// headers.set(Expires(expiration.into()));
/// ```
(Expires, "Expires") => [HttpDate]
(Expires, EXPIRES) => [HttpDate]

test_expires {
// Testcase from RFC
Expand Down
2 changes: 1 addition & 1 deletion src/common/from.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ header! {
/// headers.set(From("[email protected]".to_owned()));
/// ```
// FIXME: Maybe use mailbox?
(From, "From") => [String]
(From, FROM) => [String]

test_from {
test_header!(test1, vec![b"[email protected]"]);
Expand Down
2 changes: 1 addition & 1 deletion src/common/if_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ header! {
/// ])
/// );
/// ```
(IfMatch, "If-Match") => {Any / (EntityTag)+}
(IfMatch, IF_MATCH) => {Any / (EntityTag)+}

test_if_match {
test_header!(
Expand Down
2 changes: 1 addition & 1 deletion src/common/if_modified_since.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ header! {
/// let modified = SystemTime::now() - Duration::from_secs(60 * 60 * 24);
/// headers.set(IfModifiedSince(modified.into()));
/// ```
(IfModifiedSince, "If-Modified-Since") => [HttpDate]
(IfModifiedSince, IF_MODIFIED_SINCE) => [HttpDate]

test_if_modified_since {
// Testcase from RFC
Expand Down
2 changes: 1 addition & 1 deletion src/common/if_none_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ header! {
/// ])
/// );
/// ```
(IfNoneMatch, "If-None-Match") => {Any / (EntityTag)+}
(IfNoneMatch, IF_NONE_MATCH) => {Any / (EntityTag)+}

test_if_none_match {
test_header!(test1, vec![b"\"xyzzy\""]);
Expand Down
2 changes: 1 addition & 1 deletion src/common/if_unmodified_since.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ header! {
/// let modified = SystemTime::now() - Duration::from_secs(60 * 60 * 24);
/// headers.set(IfUnmodifiedSince(modified.into()));
/// ```
(IfUnmodifiedSince, "If-Unmodified-Since") => [HttpDate]
(IfUnmodifiedSince, IF_UNMODIFIED_SINCE) => [HttpDate]

test_if_unmodified_since {
// Testcase from RFC
Expand Down
2 changes: 1 addition & 1 deletion src/common/last_modified.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ header! {
/// let modified = SystemTime::now() - Duration::from_secs(60 * 60 * 24);
/// headers.set(LastModified(modified.into()));
/// ```
(LastModified, "Last-Modified") => [HttpDate]
(LastModified, LAST_MODIFIED) => [HttpDate]

test_last_modified {
// Testcase from RFC
Expand Down
2 changes: 1 addition & 1 deletion src/common/location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ header! {
/// headers.set(Location::new("http://www.example.com/index.html"));
/// ```
// TODO: Use URL
(Location, "Location") => Cow[str]
(Location, LOCATION) => Cow[str]

test_location {
// Testcase from RFC
Expand Down
Loading

0 comments on commit 6b859a8

Please sign in to comment.