<?xml version="1.0" encoding="US-ASCII"?>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc toc="yes" ?>
<?rfc tocdepth="1" ?>
<?rfc tocindent="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes" ?>
<?rfc subcompact="no"?>
<?rfc rfcedstyle="yes"?>

<rfc ipr="trust200902" 
     number="6585" 
     category="std"
     updates="2616"
     submissionType="IETF"
     consensus="yes">

        <link rel="convertedFrom" href="https://datatracker.ietf.org/doc/draft-nottingham-http-new-status/"/>
        <front>
                <title>Additional HTTP Status Codes</title>
                <author initials="M." surname="Nottingham" fullname="Mark Nottingham">
                        <organization>Rackspace</organization>
                        <address>
                                <email>mnot@mnot.net</email>
                                <uri>http://www.mnot.net/</uri>
                        </address>
                </author>

                <author initials="R." surname="Fielding" fullname="Roy T. Fielding">
                  <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
                  <address>
                    <postal>
                      <street>345 Park Ave.</street>
                      <city>San Jose</city>
                      <region>CA</region>
                      <code>95110</code>
                      <country>USA</country>
                    </postal>
                    <email>fielding@gbiv.com</email>
                    <uri>http://roy.gbiv.com/</uri>
                  </address>
                </author>

                <date month="April" year="2012"/>

                <abstract>

                        <t>This document specifies additional HyperText Transfer Protocol
         (HTTP) status codes for a variety of common situations.</t>

                </abstract>

        </front>

        <middle>

                <section title="Introduction">
                        <t>This document specifies additional HTTP <xref target="RFC2616"/> 
                        status codes for a variety of common situations, to improve 
                        interoperability and avoid confusion when other, less precise status 
                        codes are used.</t>
                        
                        <t>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 
                           <xref target="RFC2616"/> Section 6.1.1 for more information).</t>
                </section>

                <section title="Requirements">
                   <t>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 <xref
         target="RFC2119"/>.</t>
                </section>


                <section title="428 Precondition Required" anchor="status-428">
      <t>The 428 status code indicates that the origin server requires the
      request to be conditional.</t>
      
      <t>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.</t>

      <t>Responses using this status code SHOULD explain how to resubmit the
      request successfully. For example:</t>

                                <figure><artwork xml:space="preserve" type="message/http; msgtype=&#34;response&#34;"><![CDATA[
HTTP/1.1 428 Precondition Required
Content-Type: text/html

<html>
   <head>
      <title>Precondition Required</title>
   </head>
   <body>
      <h1>Precondition Required</h1>
      <p>This request is required to be conditional; 
      try using "If-Match".</p>
   </body>
</html>
]]></artwork></figure>

               <t>Responses with the 428 status code MUST NOT be stored by a
         cache.</t>
             </section>


                <section title="429 Too Many Requests" anchor="status-429">
                        <t>The 429 status code indicates that the user has sent too many
         requests in a given amount of time ("rate limiting").</t>

                        <t>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.</t>

                        <t>For example:</t>

                                <figure><artwork xml:space="preserve" type="message/http; msgtype=&#34;response&#34;"><![CDATA[
HTTP/1.1 429 Too Many Requests
Content-Type: text/html
Retry-After: 3600

<html>
   <head>
      <title>Too Many Requests</title>
   </head>
   <body>
      <h1>Too Many Requests</h1>
      <p>I only allow 50 requests per hour to this Web site per
         logged in user.  Try again soon.</p>
   </body>
</html>
]]></artwork></figure>

                        <t>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.</t>
                          
         <t>Responses with the 429 status code MUST NOT be stored by a
         cache.</t>
                </section>

                <section title="431 Request Header Fields Too Large" anchor="status-431">
                        <t>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. </t>

                        <t>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.</t>

                        <t>For example:</t>

                                <figure><artwork xml:space="preserve" type="message/http; msgtype=&#34;response&#34;"><![CDATA[
HTTP/1.1 431 Request Header Fields Too Large
Content-Type: text/html

<html>
   <head>
      <title>Request Header Fields Too Large</title>
   </head>
   <body>
      <h1>Request Header Fields Too Large</h1>
      <p>The "Example" header was too large.</p>
   </body>
</html>
]]></artwork></figure>

                        <t>Responses with the 431 status code MUST NOT be stored by a
                        cache.</t>
                </section>
                

                <section title="511 Network Authentication Required" anchor="status-511">
                        <t>The 511 status code indicates that the client needs to
         authenticate to gain network access.</t>

                        <t>The response representation SHOULD contain a link to a resource
         that allows the user to submit credentials (e.g., with an HTML
         form).</t>

                        <t>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.</t>

         <t>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.</t>

                        <t>Responses with the 511 status code MUST NOT be stored by a
         cache.</t>

         <section title="The 511 Status Code and Captive Portals"
          anchor="using-511">
            <t>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.</t>

                                <t>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.</t>

                                <t>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.</t>

                                <t>For example, a user agent might connect to a network and make
            the following HTTP request on TCP port 80:</t>

                                <figure><artwork xml:space="preserve" type="message/http; msgtype=&#34;request&#34;"><![CDATA[
GET /index.htm HTTP/1.1
Host: www.example.com
]]></artwork></figure>

                                <t>Upon receiving such a request, the login server would generate
            a 511 response:</t>

                                <figure><artwork xml:space="preserve" type="message/http; msgtype=&#34;response&#34;"><![CDATA[
HTTP/1.1 511 Network Authentication Required
Content-Type: text/html

<html>
   <head>
      <title>Network Authentication Required</title>
      <meta http-equiv="refresh" 
            content="0; url=https://login.example.net/">
   </head>
   <body>
      <p>You need to <a href="https://login.example.net/">
      authenticate with the local network</a> in order to gain 
      access.</p>
   </body>
</html>
]]></artwork></figure>

                                <t>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.</t>
         </section>
                 </section>


                <section title="Security Considerations" anchor="security-considerations">

                        <section title="428 Precondition Required">
                                <t>The 428 status code is optional; clients cannot rely upon its
            use to prevent "lost update" conflicts.</t>
                        </section>

                        <section title="429 Too Many Requests">
                           <t>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. </t>

            <t>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.</t>
                        </section>

                        <section title="431 Request Header Fields Too Large">
                                <t>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. </t>
                        </section>

         <section title="511 Network Authentication Required">
                 <t>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.</t>

            <t>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.</t>
              
                 <t>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.</t>
                        </section>

                </section>

                <section title="IANA Considerations">
         <t>The HTTP Status Codes registry has been updated with the
         following entries:</t>

         <?rfc subcompact="yes"?>
                        <t><list style="empty">
                           <t>Value: 428</t>
                           <t>Description: Precondition Required</t>
                           <t>Reference: [RFC6585]</t>
                        </list></t>
         <?rfc subcompact="no"?>

         <?rfc subcompact="yes"?>
                        <t><list style="empty">
                           <t>Value: 429</t>
                           <t>Description: Too Many Requests</t>
                           <t>Reference: [RFC6585]</t>
                        </list></t>
         <?rfc subcompact="no"?>

         <?rfc subcompact="yes"?>
                        <t><list style="empty">
                           <t>Value: 431</t>
                           <t>Description: Request Header Fields Too Large</t>
                           <t>Reference: [RFC6585]</t>
                        </list></t>
         <?rfc subcompact="no"?>

         <?rfc subcompact="yes"?>
                        <t><list style="empty">
                           <t>Value: 511</t>
                           <t>Description: Network Authentication Required</t>
                           <t>Reference: [RFC6585]</t>
                        </list></t>
         <?rfc subcompact="no"?>
                </section>

        </middle>

        <back>
                <references title="Normative References">
                        

<reference anchor="RFC2119">

<front>
<title abbrev="RFC Key Words">Key words for use in RFCs to Indicate Requirement Levels</title>
<author initials="S." surname="Bradner" fullname="Scott Bradner">
<organization>Harvard University</organization>
<address>
<postal>
<street>1350 Mass. Ave.</street>
<street>Cambridge</street>
<street>MA 02138</street></postal>
<phone>- +1 617 495 3864</phone>
<email>sob@harvard.edu</email></address></author>
<date year="1997" month="March"/>
<area>General</area>
<keyword>keyword</keyword>
<abstract>
<t>
   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:

<list>
<t>
      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.
</t></list></t>
<t>
   Note that the force of these words is modified by the requirement
   level of the document in which they are used.
</t></abstract></front>

<seriesInfo name="BCP" value="14"/>
<seriesInfo name="RFC" value="2119"/>
<format type="TXT" octets="4723" target="ftp://ftp.isi.edu/in-notes/rfc2119.txt"/>
<format type="HTML" octets="14486" target="http://xml.resource.org/public/rfc/html/rfc2119.html"/>
<format type="XML" octets="5661" target="http://xml.resource.org/public/rfc/xml/rfc2119.xml"/>
</reference>

                        

<reference anchor="RFC2616">

<front>
<title abbrev="HTTP/1.1">Hypertext Transfer Protocol -- HTTP/1.1</title>
<author initials="R." surname="Fielding" fullname="Roy T. Fielding">
<organization abbrev="UC Irvine">Department of Information and Computer Science</organization>
<address>
<postal>
<street>University of California, Irvine</street>
<city>Irvine</city>
<region>CA</region>
<code>92697-3425</code></postal>
<facsimile>+1(949)824-1715</facsimile>
<email>fielding@ics.uci.edu</email></address></author>
<author initials="J." surname="Gettys" fullname="James Gettys">
<organization abbrev="Compaq/W3C">World Wide Web Consortium</organization>
<address>
<postal>
<street>MIT Laboratory for Computer Science, NE43-356</street>
<street>545 Technology Square</street>
<city>Cambridge</city>
<region>MA</region>
<code>02139</code></postal>
<facsimile>+1(617)258-8682</facsimile>
<email>jg@w3.org</email></address></author>
<author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
<organization abbrev="Compaq">Compaq Computer Corporation</organization>
<address>
<postal>
<street>Western Research Laboratory</street>
<street>250 University Avenue</street>
<city>Palo Alto</city>
<region>CA</region>
<code>94305</code></postal>
<email>mogul@wrl.dec.com</email></address></author>
<author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
<organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
<address>
<postal>
<street>MIT Laboratory for Computer Science, NE43-356</street>
<street>545 Technology Square</street>
<city>Cambridge</city>
<region>MA</region>
<code>02139</code></postal>
<facsimile>+1(617)258-8682</facsimile>
<email>frystyk@w3.org</email></address></author>
<author initials="L." surname="Masinter" fullname="Larry Masinter">
<organization abbrev="Xerox">Xerox Corporation</organization>
<address>
<postal>
<street>MIT Laboratory for Computer Science, NE43-356</street>
<street>3333 Coyote Hill Road</street>
<city>Palo Alto</city>
<region>CA</region>
<code>94034</code></postal>
<email>masinter@parc.xerox.com</email></address></author>
<author initials="P." surname="Leach" fullname="Paul J. Leach">
<organization abbrev="Microsoft">Microsoft Corporation</organization>
<address>
<postal>
<street>1 Microsoft Way</street>
<city>Redmond</city>
<region>WA</region>
<code>98052</code></postal>
<email>paulle@microsoft.com</email></address></author>
<author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
<organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
<address>
<postal>
<street>MIT Laboratory for Computer Science, NE43-356</street>
<street>545 Technology Square</street>
<city>Cambridge</city>
<region>MA</region>
<code>02139</code></postal>
<facsimile>+1(617)258-8682</facsimile>
<email>timbl@w3.org</email></address></author>
<date year="1999" month="June"/>
<abstract>
<t>
   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.
</t>
<t>
   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 .
</t></abstract></front>

<seriesInfo name="RFC" value="2616"/>
<format type="TXT" octets="422317" target="http://www.rfc-editor.org/rfc/rfc2616.txt"/>
<format type="PS" octets="5529857" target="http://www.rfc-editor.org/rfc/rfc2616.ps"/>
<format type="PDF" octets="550558" target="http://www.rfc-editor.org/rfc/rfc2616.pdf"/>
<format type="HTML" octets="637302" target="http://xml.resource.org/public/rfc/html/rfc2616.html"/>
<format type="XML" octets="493420" target="http://xml.resource.org/public/rfc/xml/rfc2616.xml"/>
</reference>

                </references>

                <references title="Informative References">
                        

<reference anchor="RFC4791">

<front>
<title abbrev="CalDAV">Calendaring Extensions to WebDAV (CalDAV)</title>
<author initials="C." surname="Daboo" fullname="Cyrus Daboo">
<organization abbrev="Apple">Apple Inc.</organization>
<address>
<postal>
<street>1 Infinite Loop</street>
<city>Cupertino</city>
<region>CA</region>
<code>95014</code>
<country>USA</country></postal>
<email>cyrus@daboo.name</email>
<uri>http://www.apple.com/</uri></address></author>
<author initials="B." surname="Desruisseaux" fullname="Bernard Desruisseaux">
<organization abbrev="Oracle">Oracle Corporation</organization>
<address>
<postal>
<street>600 Blvd. de Maisonneuve West</street>
<street>Suite 1900</street>
<city>Montreal</city>
<region>QC</region>
<code>H3A 3J2</code>
<country>CANADA</country></postal>
<email>bernard.desruisseaux@oracle.com</email>
<uri>http://www.oracle.com/</uri></address></author>
<author initials="L.M." surname="Dusseault" fullname="Lisa Dusseault">
<organization abbrev="CommerceNet">CommerceNet</organization>
<address>
<postal>
<street>169 University Ave.</street>
<city>Palo Alto</city>
<region>CA</region>
<code>94301</code>
<country>USA</country></postal>
<email>ldusseault@commerce.net</email>
<uri>http://commerce.net/</uri></address></author>
<date year="2007" month="March"/>
<area>Applications</area>
<keyword>calsched</keyword>
<keyword>calsch</keyword>
<keyword>caldav</keyword>
<keyword>calendar</keyword>
<keyword>calendaring</keyword>
<keyword>scheduling</keyword>
<keyword>webdav</keyword>
<keyword>iCal</keyword>
<keyword>iCalendar</keyword>
<keyword>iTIP</keyword>
<keyword>text/calendar</keyword>
<keyword>HTTP</keyword>
<abstract>
<t>
      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.
    </t></abstract></front>

<seriesInfo name="RFC" value="4791"/>
<format type="TXT" octets="206801" target="ftp://ftp.isi.edu/in-notes/rfc4791.txt"/>
<format type="HTML" octets="300292" target="http://xml.resource.org/public/rfc/html/rfc4791.html"/>
<format type="XML" octets="265793" target="http://xml.resource.org/public/rfc/xml/rfc4791.xml"/>
</reference>


<reference anchor="Favicon" target="http://en.wikipedia.org/w/index.php?title=Favicon&amp;oldid=484627550">
<front>
<title>Favicon</title>
<author><organization>Wikipedia</organization></author>
<date year='2012' month='March' />
</front>
</reference>

<reference anchor="WebFinger" target="http://code.google.com/p/webfinger/wiki/WebFingerProtocol">
<front>
<title>WebFingerProtocol (Draft)</title>
<author>
<organization>WebFinger Project</organization></author>
<date year='2010' month='January' />
</front>

</reference>


<reference anchor="WIDGETS" target="http://www.w3.org/TR/widgets/">
<front>
<title>Widget Packaging and XML Configuration</title>
<author initials="M" surname="Caceres" role="editor">
<organization /></author>
<date year='2011' month='September' />
</front>
<seriesInfo name='W3C Recommendation' value='REC-widgets-20110927' />
</reference>

<reference anchor="P3P" target="http://www.w3.org/TR/P3P/">
<front>
<title>The Platform for Privacy Preferences 1.0 (P3P1.0) Specification</title>
<author initials="M" surname="Marchiori" role="editor">
<organization /></author>
<date year='2002' month='April' />
</front>
<seriesInfo name='W3C Recommendation' value='REC-P3P-20020416' />
</reference>


<reference anchor="CORS" target="http://www.w3.org/TR/cors/">
<front>
<title>Cross-Origin Resource Sharing</title>
<author initials="A" surname="van Kesteren" role="editor">
<organization /></author>
<date day='27' year='2010' month='July' />
</front>
<seriesInfo name='W3C Working Draft' value='WD-cors-20100727' />
</reference>


<reference anchor='RFC4918'>
<front>
<title>HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)</title>
<author initials='L.' surname='Dusseault' fullname='L. Dusseault' role="editor">
<organization /></author>
<date year='2007' month='June' />
</front>
<seriesInfo name='RFC' value='4918' />
</reference>

<!-- draft-ietf-oauth-v2-25 (IESG Evaluation::Revised ID Needed) -->
<reference anchor='OAuth2.0'>
<front>
<title>The OAuth 2.0 Authorization Protocol</title>
<author initials='E' surname='Hammer-Lahav' fullname='Eran Hammer-Lahav' role="editor">
    <organization />
</author>
<author initials='D' surname='Recordon' fullname='David Recordon'>
    <organization />
</author>
<author initials='D' surname='Hardt' fullname='Dick Hardt'>
    <organization />
</author>
<date month='March' year='2012' />
</front>
<seriesInfo name='Work in' value='Progress' />
</reference>

                </references>

                <section title="Acknowledgements">
                         <t>Thanks to
              Jan Algermissen and
              Julian Reschke
                          for their suggestions and feedback.
                         </t>
                </section>

      <section title="Issues Raised by Captive Portals" anchor="issues-511">
         <t>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.</t>
         
          <t>One example is the "favicon.ico"
         <xref target="Favicon"/> 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.</t>
         
          <t>Another browser-based issue comes about when the
         Platform for Privacy Preferences 
         <xref target="P3P"/> 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 <xref
         target="WebFinger"/>,
         Cross-Origin Resource Sharing 
         <xref target="CORS"/>, and Open Authorization
         <xref target="OAuth2.0"/> may also be
         vulnerable to such issues.</t>
         
          <t>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)
         <xref target="RFC4918"/> and Calendaring Extensions to WebDAV
         (CalDAV) <xref target="RFC4791"/> 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.</t>
         
          <t>Similarly, other non-browser applications using HTTP can be
         affected as well, e.g., widgets <xref
         target="WIDGETS"/>, software updates, and other
         specialized software such as Twitter clients and the iTunes Music
         Store.</t>
         
          <t>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.</t>
      </section>
   </back>
</rfc>
