Additional HTTP Status Codes Rackspace
mnot@mnot.net http://www.mnot.net/
Adobe Systems Incorporated
345 Park Ave. San Jose CA 95110 USA fielding@gbiv.com http://roy.gbiv.com/
This document specifies additional HyperText Transfer Protocol (HTTP) status codes for a variety of common situations.
This document specifies additional HTTP status codes for a variety of common situations, to improve interoperability and avoid confusion when other, less precise status codes are used. Note that these status codes are optional; servers cannot be required to support them. However, because clients will treat unknown status codes as a generic error of the same class (e.g., 499 is treated as 400 if it is not recognized), they can be safely deployed by existing servers (see Section 6.1.1 for more information).
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in .
The 428 status code indicates that the origin server requires the request to be conditional. Its typical use is to avoid the "lost update" problem, where a client GETs a resource's state, modifies it, and PUTs it back to the server, when meanwhile a third party has modified the state on the server, leading to a conflict. By requiring requests to be conditional, the server can assure that clients are working with the correct copies. Responses using this status code SHOULD explain how to resubmit the request successfully. For example:
Precondition Required

Precondition Required

This request is required to be conditional; try using "If-Match".

]]>
Responses with the 428 status code MUST NOT be stored by a cache.
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:
Too Many Requests

Too Many Requests

I 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.
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 is too large, and when a single header field is at fault. In the latter case, the response representation SHOULD specify which header field was too large. For example:
Request Header Fields Too Large

Request Header Fields Too Large

The "Example" header was too large.

]]>
Responses with the 431 status code MUST NOT be stored by a cache.
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 an 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.
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 encourage deployment of captive portals -- only to limit the damage caused by them. A network operator wishing to require some authentication, acceptance of terms, or other user interaction before granting access usually does so by identifying clients who have not done so ("unknown clients") using their Media Access Control (MAC) addresses. Unknown clients then have all traffic blocked, except for that on TCP port 80, which is sent to an 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:
Upon receiving such a request, the login server would generate a 511 response:
Network Authentication Required

You 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.
The 428 status code is optional; clients cannot rely upon its use to prevent "lost update" conflicts.
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.
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.
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 a Secure Socket Layer (SSL) or Transport Layer Security (TLS) connection (commonly, port 443) will generate a certificate error on the client.
The HTTP Status Codes registry has been updated with the following entries: Value: 428 Description: Precondition Required Reference: [RFC6585] Value: 429 Description: Too Many Requests Reference: [RFC6585] Value: 431 Description: Request Header Fields Too Large Reference: [RFC6585] Value: 511 Description: Network Authentication Required Reference: [RFC6585]
Key words for use in RFCs to Indicate Requirement Levels Harvard University
1350 Mass. Ave. Cambridge MA 02138 - +1 617 495 3864 sob@harvard.edu
General keyword In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. Authors who follow these guidelines should incorporate this phrase near the beginning of their document: The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119. Note that the force of these words is modified by the requirement level of the document in which they are used.
Hypertext Transfer Protocol -- HTTP/1.1 Department of Information and Computer Science
University of California, Irvine Irvine CA 92697-3425 +1(949)824-1715 fielding@ics.uci.edu
World Wide Web Consortium
MIT Laboratory for Computer Science, NE43-356 545 Technology Square Cambridge MA 02139 +1(617)258-8682 jg@w3.org
Compaq Computer Corporation
Western Research Laboratory 250 University Avenue Palo Alto CA 94305 mogul@wrl.dec.com
World Wide Web Consortium
MIT Laboratory for Computer Science, NE43-356 545 Technology Square Cambridge MA 02139 +1(617)258-8682 frystyk@w3.org
Xerox Corporation
MIT Laboratory for Computer Science, NE43-356 3333 Coyote Hill Road Palo Alto CA 94034 masinter@parc.xerox.com
Microsoft Corporation
1 Microsoft Way Redmond WA 98052 paulle@microsoft.com
World Wide Web Consortium
MIT Laboratory for Computer Science, NE43-356 545 Technology Square Cambridge MA 02139 +1(617)258-8682 timbl@w3.org
The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. It is a generic, stateless, protocol which can be used for many tasks beyond its use for hypertext, such as name servers and distributed object management systems, through extension of its request methods, error codes and headers . A feature of HTTP is the typing and negotiation of data representation, allowing systems to be built independently of the data being transferred. HTTP has been in use by the World-Wide Web global information initiative since 1990. This specification defines the protocol referred to as "HTTP/1.1", and is an update to RFC 2068 .
Calendaring Extensions to WebDAV (CalDAV) Apple Inc.
1 Infinite Loop Cupertino CA 95014 USA cyrus@daboo.name http://www.apple.com/
Oracle Corporation
600 Blvd. de Maisonneuve West Suite 1900 Montreal QC H3A 3J2 CANADA bernard.desruisseaux@oracle.com http://www.oracle.com/
CommerceNet
169 University Ave. Palo Alto CA 94301 USA ldusseault@commerce.net http://commerce.net/
Applications calsched calsch caldav calendar calendaring scheduling webdav iCal iCalendar iTIP text/calendar HTTP This document defines extensions to the Web Distributed Authoring and Versioning (WebDAV) protocol to specify a standard way of accessing, managing, and sharing calendaring and scheduling information based on the iCalendar format. This document defines the "calendar-access" feature of CalDAV.
Favicon Wikipedia WebFingerProtocol (Draft) WebFinger Project Widget Packaging and XML Configuration The Platform for Privacy Preferences 1.0 (P3P1.0) Specification Cross-Origin Resource Sharing HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV) The OAuth 2.0 Authorization Protocol
Thanks to Jan Algermissen and Julian Reschke for their suggestions and feedback.
Since clients cannot differentiate between a portal's response and that of the HTTP server that they intended to communicate with, a number of issues arise. The 511 status code is intended to help mitigate some of them. One example is the "favicon.ico" commonly used by browsers to identify the site being accessed. If the favicon for a given site is fetched from a captive portal instead of the intended site (e.g., because the user is unauthenticated), it will often "stick" in the browser's cache (most implementations cache favicons aggressively) beyond the portal session, so that it seems as if the portal's favicon has "taken over" the legitimate site. Another browser-based issue comes about when the Platform for Privacy Preferences is supported. Depending on how it is implemented, it's possible a browser might interpret a portal's response for the p3p.xml file as the server's, resulting in the privacy policy (or lack thereof) advertised by the portal being interpreted as applying to the intended site. Other Web-based protocols such as WebFinger , Cross-Origin Resource Sharing , and Open Authorization may also be vulnerable to such issues. Although HTTP is most widely used with Web browsers, a growing number of non-browsing applications use it as a substrate protocol. For example, Web Distributed Authoring and Versioning (WebDAV) and Calendaring Extensions to WebDAV (CalDAV) both use HTTP as the basis (for remote authoring and calendaring, respectively). Using these applications from behind a captive portal can result in spurious errors being presented to the user, and might result in content corruption, in extreme cases. Similarly, other non-browser applications using HTTP can be affected as well, e.g., widgets , software updates, and other specialized software such as Twitter clients and the iTunes Music Store. It should be noted that it's sometimes believed that using HTTP redirection to direct traffic to the portal addresses these issues. However, since many of these uses "follow" redirects, this is not a good solution.