Network Working Group M. Nottingham Internet-Draft Updates: 2616 (if approved) R. Fielding Intended status: Standards Track Adobe Expires: February 14, 2012 August 13, 2011 Additional HTTP Status Codes draft-nottingham-http-new-status-01 Abstract This document specifies additional HyperText Transfer Protocol (HTTP) status codes for a variety of common situations. Status of this Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at http://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire on February 14, 2012. Copyright Notice Copyright (c) 2011 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Nottingham & Fielding Expires February 14, 2012 [Page 1] Internet-Draft Additional HTTP Status Codes August 2011 Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Requirements . . . . . . . . . . . . . . . . . . . . . . . . . 3 3. 428 Network Authentication Required . . . . . . . . . . . . . . 3 3.1. The 428 Status Code and Captive Portals . . . . . . . . . . 3 4. 429 Limit Exceeded . . . . . . . . . . . . . . . . . . . . . . 4 5. 431 Request Header Fields Too Large . . . . . . . . . . . . . . 5 6. Security Considerations . . . . . . . . . . . . . . . . . . . . 6 6.1. 428 Network Authentication Required . . . . . . . . . . . . 6 6.2. 429 Limit Exceeded . . . . . . . . . . . . . . . . . . . . 6 6.3. 431 Request Header Fields Too Large . . . . . . . . . . . . 6 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 6 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 7 8.1. Normative References . . . . . . . . . . . . . . . . . . . 7 8.2. Informative References . . . . . . . . . . . . . . . . . . 7 Appendix A. Issues Raised by Captive Portals . . . . . . . . . . . 7 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 8 Nottingham & Fielding Expires February 14, 2012 [Page 2] Internet-Draft Additional HTTP Status Codes August 2011 1. Introduction This document specifies additional HTTP [RFC2616] status codes for a variety of common situations, to improve interoperability and avoid confusion when other, less precise status codes are used. Feedback should occur on the ietf-http-wg@w3.org mailing list, although this draft is NOT a work item of the IETF HTTPbis Working Group. 2. Requirements 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 [RFC2119]. 3. 428 Network Authentication Required This status code indicates that the client needs to authenticate to gain network access. The response representation SHOULD indicate how to do this; e.g., with an HTML form for submitting credentials. The 428 status SHOULD NOT be generated by origin servers; it is intended for use by intermediaries. Responses with the 428 status code MUST NOT be stored by a cache. 3.1. The 428 Status Code and Captive Portals This section demonstrates a typical use of the 428 status code; it is not normative. See Appendix A for an explanation of the issues that motivate this status code. A network operator wishing to require some authentication, acceptance of terms or other user interaction before granting access usually does so by identify 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 Nottingham & Fielding Expires February 14, 2012 [Page 3] Internet-Draft Additional HTTP Status Codes August 2011 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 428 response: HTTP/1.1 428 Network Authentication Required Refresh: 0; url=https://login.example.net/ Content-Type: text/html
I only allow 50 requests per hour to this Web site. Try again soon.
Note that this specification does not define specific limits, nor their scope. 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. Responses with the 429 status code MUST NOT be stored by a cache. 5. 431 Request Header Fields Too Large This 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 field was too large. For example: HTTP/1.1 431 Request Header Fields Too Large Content-Type: text/htmlThe "Example" header was too large.
Nottingham & Fielding Expires February 14, 2012 [Page 5] Internet-Draft Additional HTTP Status Codes August 2011 Responses with the 431 status code MUST NOT be stored by a cache. 6. Security Considerations 6.1. 428 Network Authentication Required In common use, a response carrying the 428 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 428 status code; in other words, a captive portal that is not using this status code introduces the same issues. 6.2. 429 Limit Exceeded 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. 6.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. IANA Considerations The HTTP Status Codes Registry should be updated with the following entries: o Code: 428 o Description: Network Authentication Required o Specification: [ this document ] o Code: 429 o Description: Limit Exceeded o Specification: [ this document ] o Code: 431 o Description: Request Header Fields Too Large Nottingham & Fielding Expires February 14, 2012 [Page 6] Internet-Draft Additional HTTP Status Codes August 2011 o Specification: [ this document ] 8. References 8.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. 8.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. Appendix A. Issues Raised by Captive Portals 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. One example is the "favicon.ico"