Network Working Group M. Nottingham
Internet-Draft Rackspace
Updates: 2616 (if approved) R. Fielding
Intended status: Standards Track Adobe
Expires: August 7, 2012 February 4, 2012
Additional HTTP Status Codes
draft-nottingham-http-new-status-04
Abstract
This document specifies additional HyperText Transfer Protocol (HTTP)
status codes for a variety of common situations.
Editorial Note (To be removed by RFC Editor before publication)
Distribution of this document is unlimited. Although this is not a
work item of the HTTPbis Working Group, comments should be sent to
the Hypertext Transfer Protocol (HTTP) mailing list at
ietf-http-wg@w3.org [1], which may be joined by sending a message
with subject "subscribe" to ietf-http-wg-request@w3.org [2].
Discussions of the HTTPbis Working Group are archived at
This request is required to be conditional; try using "If-Match".
Nottingham & Fielding Expires August 7, 2012 [Page 3] Internet-Draft Additional HTTP Status Codes February 2012 Responses with the 428 status code MUST NOT be stored by a cache. 4. 429 Too Many Requests The 429 status code indicates that the user has sent too many requests in a given amount of time ("rate limiting"). The response representations SHOULD include details explaining the condition, and MAY include a Retry-After header indicating how long to wait before making a new request. For example: HTTP/1.1 429 Too Many Requests Content-Type: text/html Retry-After: 3600I only allow 50 requests per hour to this Web site per logged in user. Try again soon.
Note that this specification does not define how the origin server identifies the user, nor how it counts requests. For example, an origin server that is limiting request rates can do so based upon counts of requests on a per-resource basis, across the entire server, or even among a set of servers. Likewise, it might identify the user by its authentication credentials, or a stateful cookie. Responses with the 429 status code MUST NOT be stored by a cache. 5. 431 Request Header Fields Too Large The 431 status code indicates that the server is unwilling to process the request because its header fields are too large. The request MAY be resubmitted after reducing the size of the request header fields. It can be used both when the set of request header fields in total are too large, and when a single header field is at fault. In the latter case, the response representation SHOULD specify which header Nottingham & Fielding Expires August 7, 2012 [Page 4] Internet-Draft Additional HTTP Status Codes February 2012 field was too large. For example: HTTP/1.1 431 Request Header Fields Too Large Content-Type: text/htmlThe "Example" header was too large.
Responses with the 431 status code MUST NOT be stored by a cache. 6. 511 Network Authentication Required The 511 status code indicates that the client needs to authenticate to gain network access. The response representation SHOULD contain a link to a resource that allows the user to submit credentials (e.g. with a HTML form). Note that the 511 response SHOULD NOT contain a challenge or the login interface itself, because browsers would show the login interface as being associated with the originally requested URL, which may cause confusion. The 511 status SHOULD NOT be generated by origin servers; it is intended for use by intercepting proxies that are interposed as a means of controlling access to the network. Responses with the 511 status code MUST NOT be stored by a cache. 6.1. The 511 Status Code and Captive Portals The 511 status code is designed to mitigate problems caused by "captive portals" to software (especially non-browser agents) that is expecting a response from the server that a request was made to, not the intervening network infrastructure. It is not intended to encouraged deployment of captive portals, only to limit the damage caused by them. Nottingham & Fielding Expires August 7, 2012 [Page 5] Internet-Draft Additional HTTP Status Codes February 2012 A network operator wishing to require some authentication, acceptance of terms or other user interaction before granting access usually does so by identifing clients who have not done so ("unknown clients") using their MAC addresses. Unknown clients then have all traffic blocked, except for that on TCP port 80, which is sent to a HTTP server (the "login server") dedicated to "logging in" unknown clients, and of course traffic to the login server itself. For example, a user agent might connect to a network and make the following HTTP request on TCP port 80: GET /index.htm HTTP/1.1 Host: www.example.com Upon receiving such a request, the login server would generate a 511 response: HTTP/1.1 511 Network Authentication Required Content-Type: text/htmlYou need to authenticate with the local network in order to gain access.
Here, the 511 status code assures that non-browser clients will not interpret the response as being from the origin server, and the META HTML element redirects the user agent to the login server. 7. Security Considerations 7.1. 428 Precondition Required The 428 status code is optional; clients cannot rely upon its use to prevent "lost update" conflicts. Nottingham & Fielding Expires August 7, 2012 [Page 6] Internet-Draft Additional HTTP Status Codes February 2012 7.2. 429 Too Many Requests When a server is under attack or just receiving a very large number of requests from a single party, responding to each with a 429 status code will consume resources. Therefore, servers are not required to use the 429 status code; when limiting resource usage, it may be more appropriate to just drop connections, or take other steps. 7.3. 431 Request Header Fields Too Large Servers are not required to use the 431 status code; when under attack, it may be more appropriate to just drop connections, or take other steps. 7.4. 511 Network Authentication Required In common use, a response carrying the 511 status code will not come from the origin server indicated in the request's URL. This presents many security issues; e.g., an attacking intermediary may be inserting cookies into the original domain's name space, may be observing cookies or HTTP authentication credentials sent from the user agent, and so on. However, these risks are not unique to the 511 status code; in other words, a captive portal that is not using this status code introduces the same issues. Also, note that captive portals using this status code on an SSL or TLS connection (commonly, port 443) will generate a certificate error on the client. 8. IANA Considerations The HTTP Status Codes Registry should be updated with the following entries: o Code: 428 o Description: Precondition Required o Specification: [ this document ] o Code: 429 o Description: Too Many Requests o Specification: [ this document ] Nottingham & Fielding Expires August 7, 2012 [Page 7] Internet-Draft Additional HTTP Status Codes February 2012 o Code: 431 o Description: Request Header Fields Too Large o Specification: [ this document ] o Code: 511 o Description: Network Authentication Required o Specification: [ this document ] 9. References 9.1. Normative References [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 9.2. Informative References [RFC4791] Daboo, C., Desruisseaux, B., and L. Dusseault, "Calendaring Extensions to WebDAV (CalDAV)", RFC 4791, March 2007. [RFC4918] Dusseault, L., "HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)", RFC 4918, June 2007. URIs [1]