1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557
|
<pre>Internet Engineering Task Force (IETF) M. Nottingham
Request for Comments: 6585 Rackspace
Updates: <a href="./rfc2616">2616</a> R. Fielding
Category: Standards Track Adobe
ISSN: 2070-1721 April 2012
<span class="h1">Additional HTTP Status Codes</span>
Abstract
This document specifies additional HyperText Transfer Protocol (HTTP)
status codes for a variety of common situations.
Status of This Memo
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in <a href="./rfc5741#section-2">Section 2 of RFC 5741</a>.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
<a href="http://www.rfc-editor.org/info/rfc6585">http://www.rfc-editor.org/info/rfc6585</a>.
Copyright Notice
Copyright (c) 2012 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal
Provisions Relating to IETF Documents
(<a href="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</a>) 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.
<span class="grey">Nottingham & Fielding Standards Track [Page 1]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
<span class="grey"><a href="./rfc6585">RFC 6585</a> Additional HTTP Status Codes April 2012</span>
Table of Contents
<a href="#section-1">1</a>. Introduction ....................................................<a href="#page-2">2</a>
<a href="#section-2">2</a>. Requirements ....................................................<a href="#page-2">2</a>
<a href="#section-3">3</a>. 428 Precondition Required .......................................<a href="#page-2">2</a>
<a href="#section-4">4</a>. 429 Too Many Requests ...........................................<a href="#page-3">3</a>
<a href="#section-5">5</a>. 431 Request Header Fields Too Large .............................<a href="#page-4">4</a>
<a href="#section-6">6</a>. 511 Network Authentication Required .............................<a href="#page-4">4</a>
<a href="#section-7">7</a>. Security Considerations .........................................<a href="#page-6">6</a>
<a href="#section-8">8</a>. IANA Considerations .............................................<a href="#page-7">7</a>
<a href="#section-9">9</a>. References ......................................................<a href="#page-7">7</a>
<a href="#appendix-A">Appendix A</a>. Acknowledgements .......................................<a href="#page-9">9</a>
<a href="#appendix-B">Appendix B</a>. Issues Raised by Captive Portals .......................<a href="#page-9">9</a>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
This document specifies additional HTTP [<a href="./rfc2616" title=""Hypertext Transfer Protocol -- HTTP/1.1"">RFC2616</a>] 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 <a href="./rfc2616#section-6.1.1">[RFC2616] Section 6.1.1</a> for more information).
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Requirements</span>
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 [<a href="./rfc2119" title=""Key words for use in RFCs to Indicate Requirement Levels"">RFC2119</a>].
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. 428 Precondition Required</span>
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:
HTTP/1.1 428 Precondition Required
Content-Type: text/html
<span class="grey">Nottingham & Fielding Standards Track [Page 2]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
<span class="grey"><a href="./rfc6585">RFC 6585</a> Additional HTTP Status Codes April 2012</span>
<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>
Responses with the 428 status code MUST NOT be stored by a cache.
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. 429 Too Many Requests</span>
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: 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>
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.
<span class="grey">Nottingham & Fielding Standards Track [Page 3]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
<span class="grey"><a href="./rfc6585">RFC 6585</a> Additional HTTP Status Codes April 2012</span>
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. 431 Request Header Fields Too Large</span>
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:
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>
Responses with the 431 status code MUST NOT be stored by a cache.
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. 511 Network Authentication Required</span>
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.
<span class="grey">Nottingham & Fielding Standards Track [Page 4]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
<span class="grey"><a href="./rfc6585">RFC 6585</a> Additional HTTP Status Codes April 2012</span>
<span class="h3"><a class="selflink" id="section-6.1" href="#section-6.1">6.1</a>. The 511 Status Code and Captive Portals</span>
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:
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/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>
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.
<span class="grey">Nottingham & Fielding Standards Track [Page 5]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
<span class="grey"><a href="./rfc6585">RFC 6585</a> Additional HTTP Status Codes April 2012</span>
<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. Security Considerations</span>
<span class="h3"><a class="selflink" id="section-7.1" href="#section-7.1">7.1</a>. 428 Precondition Required</span>
The 428 status code is optional; clients cannot rely upon its use to
prevent "lost update" conflicts.
<span class="h3"><a class="selflink" id="section-7.2" href="#section-7.2">7.2</a>. 429 Too Many Requests</span>
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.
<span class="h3"><a class="selflink" id="section-7.3" href="#section-7.3">7.3</a>. 431 Request Header Fields Too Large</span>
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.
<span class="h3"><a class="selflink" id="section-7.4" href="#section-7.4">7.4</a>. 511 Network Authentication Required</span>
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.
<span class="grey">Nottingham & Fielding Standards Track [Page 6]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
<span class="grey"><a href="./rfc6585">RFC 6585</a> Additional HTTP Status Codes April 2012</span>
<span class="h2"><a class="selflink" id="section-8" href="#section-8">8</a>. IANA Considerations</span>
The HTTP Status Codes registry has been updated with the following
entries:
Value: 428
Description: Precondition Required
Reference: [<a href="./rfc6585">RFC6585</a>]
Value: 429
Description: Too Many Requests
Reference: [<a href="./rfc6585">RFC6585</a>]
Value: 431
Description: Request Header Fields Too Large
Reference: [<a href="./rfc6585">RFC6585</a>]
Value: 511
Description: Network Authentication Required
Reference: [<a href="./rfc6585">RFC6585</a>]
<span class="h2"><a class="selflink" id="section-9" href="#section-9">9</a>. References</span>
<span class="h3"><a class="selflink" id="section-9.1" href="#section-9.1">9.1</a>. Normative References</span>
[<a id="ref-RFC2119">RFC2119</a>] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>, March 1997.
[<a id="ref-RFC2616">RFC2616</a>] Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext
Transfer Protocol -- HTTP/1.1", <a href="./rfc2616">RFC 2616</a>, June 1999.
<span class="h3"><a class="selflink" id="section-9.2" href="#section-9.2">9.2</a>. Informative References</span>
[<a id="ref-CORS">CORS</a>] van Kesteren, A., Ed., "Cross-Origin Resource Sharing",
W3C Working Draft WD-cors-20100727, July 2010,
<<a href="http://www.w3.org/TR/cors/">http://www.w3.org/TR/cors/</a>>.
[<a id="ref-Favicon">Favicon</a>] Wikipedia, "Favicon", March 2012,
<<a href="http://en.wikipedia.org/w/index.php?title=Favicon&oldid=484627550">http://en.wikipedia.org/w/</a>
<a href="http://en.wikipedia.org/w/index.php?title=Favicon&oldid=484627550">index.php?title=Favicon&oldid=484627550</a>>.
[<a id="ref-OAuth2.0">OAuth2.0</a>] Hammer-Lahav, E., Ed., Recordon, D., and D. Hardt, "The
OAuth 2.0 Authorization Protocol", Work in Progress,
March 2012.
<span class="grey">Nottingham & Fielding Standards Track [Page 7]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
<span class="grey"><a href="./rfc6585">RFC 6585</a> Additional HTTP Status Codes April 2012</span>
[<a id="ref-P3P">P3P</a>] Marchiori, M., Ed., "The Platform for Privacy Preferences
1.0 (P3P1.0) Specification", W3C Recommendation
REC-P3P-20020416, April 2002,
<<a href="http://www.w3.org/TR/P3P/">http://www.w3.org/TR/P3P/</a>>.
[<a id="ref-RFC4791">RFC4791</a>] Daboo, C., Desruisseaux, B., and L. Dusseault,
"Calendaring Extensions to WebDAV (CalDAV)", <a href="./rfc4791">RFC 4791</a>,
March 2007.
[<a id="ref-RFC4918">RFC4918</a>] Dusseault, L., Ed., "HTTP Extensions for Web Distributed
Authoring and Versioning (WebDAV)", <a href="./rfc4918">RFC 4918</a>, June 2007.
[<a id="ref-WIDGETS">WIDGETS</a>] Caceres, M., Ed., "Widget Packaging and XML
Configuration", W3C Recommendation REC-widgets-20110927,
September 2011, <<a href="http://www.w3.org/TR/widgets/">http://www.w3.org/TR/widgets/</a>>.
[<a id="ref-WebFinger">WebFinger</a>] WebFinger Project, "WebFingerProtocol (Draft)",
January 2010, <<a href="http://code.google.com/p/webfinger/wiki/WebFingerProtocol">http://code.google.com/p/webfinger/wiki/</a>
<a href="http://code.google.com/p/webfinger/wiki/WebFingerProtocol">WebFingerProtocol</a>>.
<span class="grey">Nottingham & Fielding Standards Track [Page 8]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
<span class="grey"><a href="./rfc6585">RFC 6585</a> Additional HTTP Status Codes April 2012</span>
<span class="h2"><a class="selflink" id="appendix-A" href="#appendix-A">Appendix A</a>. Acknowledgements</span>
Thanks to Jan Algermissen and Julian Reschke for their suggestions
and feedback.
<span class="h2"><a class="selflink" id="appendix-B" href="#appendix-B">Appendix B</a>. Issues Raised by Captive Portals</span>
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" [<a href="#ref-Favicon" title=""Favicon"">Favicon</a>] 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 [<a href="#ref-P3P" title=""The Platform for Privacy Preferences 1.0 (P3P1.0) Specification"">P3P</a>] 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
[<a href="#ref-WebFinger" title=""WebFingerProtocol (Draft)"">WebFinger</a>], Cross-Origin Resource Sharing [<a href="#ref-CORS" title=""Cross-Origin Resource Sharing"">CORS</a>], and Open
Authorization [<a href="#ref-OAuth2.0" title=""The OAuth 2.0 Authorization Protocol"">OAuth2.0</a>] 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) [<a href="./rfc4918" title=""HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)"">RFC4918</a>]
and Calendaring Extensions to WebDAV (CalDAV) [<a href="./rfc4791" title=""Calendaring Extensions to WebDAV (CalDAV)"">RFC4791</a>] 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 [<a href="#ref-WIDGETS" title=""Widget Packaging and XML Configuration"">WIDGETS</a>], 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.
<span class="grey">Nottingham & Fielding Standards Track [Page 9]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
<span class="grey"><a href="./rfc6585">RFC 6585</a> Additional HTTP Status Codes April 2012</span>
Authors' Addresses
Mark Nottingham
Rackspace
EMail: mnot@mnot.net
URI: <a href="http://www.mnot.net/">http://www.mnot.net/</a>
Roy T. Fielding
Adobe Systems Incorporated
345 Park Ave.
San Jose, CA 95110
USA
EMail: fielding@gbiv.com
URI: <a href="http://roy.gbiv.com/">http://roy.gbiv.com/</a>
Nottingham & Fielding Standards Track [Page 10]
</pre>
|