-
-
Notifications
You must be signed in to change notification settings - Fork 12
RFC 2616 -> RFC 7231 #10
base: master
Are you sure you want to change the base?
Changes from 1 commit
39cc6d7
cd6363f
ccd371a
bdb0f47
48c77c1
6908f05
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ use std::cmp::{PartialEq, Eq, PartialOrd, Ord}; | |
use std::fmt; | ||
use std::mem::transmute; | ||
|
||
/// An HTTP status code (`Status-Code` in RFC 2616). | ||
/// An HTTP status code (`Status-Code` in RFC 7231). | ||
/// | ||
/// This enum is absolutely exhaustive, covering all 500 possible values (100–599). | ||
/// | ||
|
@@ -653,13 +653,13 @@ pub enum StatusCode { | |
/// 412 Precondition Failed | ||
PreconditionFailed = 412, | ||
/// 413 Request Entity Too Large | ||
RequestEntityTooLarge = 413, | ||
PayloadTooLarge = 413, | ||
/// 414 Request-URI Too Long | ||
RequestUriTooLong = 414, | ||
UriTooLong = 414, | ||
/// 415 Unsupported Media Type | ||
UnsupportedMediaType = 415, | ||
/// 416 Requested Range Not Satisfiable | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These doc comments need updating too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi, I'should do it by the end of the day Chris On Tue, Jul 1, 2014 at 2:33 AM, Chris Morgan [email protected]
|
||
RequestedRangeNotSatisfiable = 416, | ||
RangeNotSatisfiable = 416, | ||
/// 417 Expectation Failed | ||
ExpectationFailed = 417, | ||
/// 418 I'm a teapot | ||
|
@@ -1359,10 +1359,10 @@ impl StatusCode { | |
Gone => Some("Gone"), | ||
LengthRequired => Some("Length Required"), | ||
PreconditionFailed => Some("Precondition Failed"), | ||
RequestEntityTooLarge => Some("Request Entity Too Large"), | ||
RequestUriTooLong => Some("Request-URI Too Long"), | ||
PayloadTooLarge => Some("Payload Too Large"), | ||
UriTooLong => Some("URI Too Long"), | ||
UnsupportedMediaType => Some("Unsupported Media Type"), | ||
RequestedRangeNotSatisfiable => Some("Requested Range Not Satisfiable"), | ||
RangeNotSatisfiable => Some("Range Not Satisfiable"), | ||
ExpectationFailed => Some("Expectation Failed"), | ||
ImATeapot => Some("I'm a teapot"), | ||
AuthenticationTimeout => Some("Authentication Timeout"), | ||
|
@@ -1663,8 +1663,8 @@ impl ToPrimitive for StatusCode { | |
|
||
/// The class of an HTTP `Status-Code`. | ||
/// | ||
/// [RFC 2616, section 6.1.1 (Status Code and Reason | ||
/// Phrase)](https://tools.ietf.org/html/rfc2616#section-6.1.1): | ||
/// [RFC 7231, section 6 (Response Status Codes)] | ||
/// (https://tools.ietf.org/html/rfc7231#section-6): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The body of this quotation has also changed and should be updated. |
||
/// | ||
/// > The first digit of the Status-Code defines the class of response. The | ||
/// > last two digits do not have any categorization role. | ||
|
@@ -1718,24 +1718,18 @@ impl StatusClass { | |
/// assert_eq!(ClientError.default_code(), BadRequest); | ||
/// ``` | ||
/// | ||
/// The use for this is outlined in [RFC 2616, section 6.1.1 (Status Code and Reason | ||
/// Phrase)](https://tools.ietf.org/html/rfc2616#section-6.1.1): | ||
/// The use for this is outlined in [RFC 7231, section 6 (Response Status Code)] | ||
/// (https://tools.ietf.org/html/rfc7231#section-6): | ||
/// | ||
/// > HTTP status codes are extensible. HTTP applications are not required | ||
/// > to understand the meaning of all registered status codes, though such | ||
/// > understanding is obviously desirable. However, applications MUST | ||
/// > HTTP status codes are extensible. HTTP clients are not required to | ||
/// > understand the meaning of all registered status codes, though such | ||
/// > understanding is obviously desirable. However, a client MUST | ||
/// > understand the class of any status code, as indicated by the first | ||
/// > digit, and treat any unrecognized response as being equivalent to the | ||
/// > x00 status code of that class, with the exception that an | ||
/// > unrecognized response MUST NOT be cached. For example, if an | ||
/// > unrecognized status code of 431 is received by the client, it can | ||
/// > safely assume that there was something wrong with its request and | ||
/// > treat the response as if it had received a 400 status code. In such | ||
/// > cases, user agents SHOULD present to the user the entity returned | ||
/// > with the response, since that entity is likely to include human- | ||
/// > readable information which will explain the unusual status. | ||
/// > digit, and treat an unrecognized status code as being equivalent to | ||
/// > the x00 status code of that class, with the exception that a | ||
/// > recipient MUST NOT cache a response with an unrecognized status code. | ||
/// | ||
/// This is demonstrated thusly (I’ll use 432 rather than 431 as 431 *is* now in use): | ||
/// This is demonstrated thusly (I’ll use 432): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The next paragraph in RFC 7231 contains an example, now using 471; seems to me that including the paragraph and using 471 rather than 432 would be a good idea. |
||
/// | ||
/// ```rust | ||
/// # use httpcommon::status::{Code432, BadRequest}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s actually
status-code
in RFC 7231, notStatus-Code
.