diff --git a/content/100.md b/content/100.md index 75c1822b..99f14031 100644 --- a/content/100.md +++ b/content/100.md @@ -1,17 +1,46 @@ ## Description -The HTTP `100 Continue` informational status response code -indicates that everything so far is OK and that the client should continue with the -request or ignore it if it is already finished. +The HTTP **`100 Continue`** [informational response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#informational_responses) status code indicates that the initial part of a request has been received and has not yet been rejected by the server. The client should continue with a request or discard the 100 response if the request is already finished. +When a request has an [`Expect: 100-continue`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Expect) header, the 100 Continue response indicates that the server is ready or capable of receiving the request content. Waiting for a 100 Continue response can be helpful if a client anticipates that an error is likely, for example, when sending state-changing operations without previously verified authentication credentials. -To have a server check the request's headers, a client must send -`Expect: 100-continue` as a header in its initial request -and receive a `100 Continue` status code in response before sending the body. +### Examples -### See Also +The following [`PUT`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/PUT) request sends information to a server about a file upload. The client is indicating that it will proceed with the content if it receives a 100 response to avoid sending data over the network that could result in an error like [`405`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/405), [`401`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/401), or [`403`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/403). At first, the client sends headers only, including an [`Expect: 100-continue`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Expect) header: -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.100) -- [Expect](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expect), the header that triggers the `100 Continue` expectation +http -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/100](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/100) + PUT /videos HTTP/1.1 + Host: uploads.example.com + Content-Type: video/h264 + Content-Length: 123456789 + Expect: 100-continue + + +The server indicates that the request can proceed: + +http + + HTTP/1.1 100 Continue + + +The client completes the request by sending the actual data: + +http + + [Video data as content for PUT request] + + +### Specifications + +Specification + +[HTTP Semantics +\# status.100](https://www.rfc-editor.org/rfc/rfc9110#status.100) + +### See also + +* [`Expect`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Expect) +* [`417`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/417) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/100](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/100) diff --git a/content/101.md b/content/101.md index 129ecb4c..141afb6a 100644 --- a/content/101.md +++ b/content/101.md @@ -1,20 +1,40 @@ ## Description -The HTTP `101 Switching Protocols` response code indicates -a protocol to which the server switches. -The protocol is specified in the [Upgrade](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Upgrade) request header received from a client. +The HTTP **`101 Switching Protocols`** [informational response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#informational_responses) status code indicates the protocol that a server has switched to. The protocol is specified in the [`Upgrade`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Upgrade) request header received from a client. -The server includes in this response an [Upgrade](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Upgrade) response header to -indicate the protocol it switched to. +The server includes an [`Upgrade`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Upgrade) header in this response to indicate the protocol it has agreed to switch to. The process is described in detail in the [Protocol upgrade mechanism](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Protocol_upgrade_mechanism) guide. -The process is described in the following article: -[Protocol upgrade mechanism](https://developer.mozilla.org/en-US/docs/Web/HTTP/Protocol_upgrade_mechanism) +### Examples -### See Also +The following example shows how switching protocols might be used with [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API). A client sends a [`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET) HTTP request with an [`Upgrade`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Upgrade) header which must also be listed in the [`Connection`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Connection) header. The server agrees to switch protocols, returning a 101 response meaning the connection has switched from HTTP to WebSocket. At this point, the client and server can now start exchanging WebSocket data. Information about how to set `Sec-WebSocket-*` headers for handshake negotiation can be found in [WebSocket-specific headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Protocol_upgrade_mechanism#websocket-specific_headers). -- [Spec](https://httpwg.org/specs/rfc9110.html#status.101) -- [Upgrade](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Upgrade), the header that triggers the protocol switch -- [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API), a protocol which can be used with this status code -- [426 Upgrade Required](https://http.cat/status/426), a status code that can be used to notify the client to switch to a different protocol +http -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/101](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/101) + GET /notifications HTTP/1.1 + Host: example.com + Upgrade: websocket + Connection: Upgrade + + +http + + HTTP/1.1 101 Switching Protocols + Upgrade: websocket + Connection: Upgrade + + +### Specifications + +Specification + +[HTTP Semantics +\# status.101](https://httpwg.org/specs/rfc9110.html#status.101) + +### See also + +* [Protocol upgrade mechanism](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Protocol_upgrade_mechanism) +* [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) +* [`Upgrade`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Upgrade) +* [`426 Upgrade Required`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/426) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/101](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/101) diff --git a/content/102.md b/content/102.md index 6f70ca2b..48194c22 100644 --- a/content/102.md +++ b/content/102.md @@ -1,15 +1,26 @@ ## Description - +**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the [compatibility table](#browser_compatibility) at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time. -The HTTP `102 Processing` informational status response code indicates to client that a full request has been received and the server is working on it. +The HTTP **`102 Processing`** [informational response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#informational_responses) status code indicates to client that a full request has been received and the server is working on it. This status code is only sent if the server expects the request to take significant time. -This status code is only sent if the server expects the request to take significant time. It tells the client that your request is not dead yet. +**Note:** Regular web servers do not return this response. This status code was first introduced in Web Distributed Authoring and Versioning ([WebDAV](https://developer.mozilla.org/en-US/docs/Glossary/WebDAV)) [RFC 2518](https://datatracker.ietf.org/doc/html/rfc2518), but it was removed from WebDAV in [RFC 4918](https://datatracker.ietf.org/doc/html/rfc4918). -### See Also +### Specifications -- [Spec](https://tools.ietf.org/html/rfc2518#section-10.1) -- [Expect](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expect) -- [100 Continue](https://http.cat/status/100) +Specification -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/102](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/102) +[Unknown specification +\# section-10.1](https://www.rfc-editor.org/rfc/rfc2518.html#section-10.1) + +### Browser compatibility + +This feature is deprecated and browsers will ignore this response status code. + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`100`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/100) +* [rfc4918 '102 Processing' removal notes](https://www.rfc-editor.org/rfc/rfc4918#section-21.4) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/102](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/102) diff --git a/content/103.md b/content/103.md index 4223f0f7..683f5e97 100644 --- a/content/103.md +++ b/content/103.md @@ -1,23 +1,120 @@ ## Description - +The HTTP **`103 Early Hints`** [informational response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#informational_responses) may be sent by a server while it is still preparing a response, with hints about the sites and resources that the server expects the final response will link to. This allows a browser to [preconnect](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel/preconnect) to sites or start [preloading](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel/preload) resources even before the server has prepared and sent a final response. Preloaded resources indicated by early hints are fetched by the client as soon as the hints are received. -The HTTP `103 Early Hints` [information response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#information_responses) may be sent by a server while it is still preparing a response, with hints about the resources that the server is expecting the final response will link. +The early hint response is primarily intended for use with the [`Link`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Link) header, which indicates the resources to be loaded. It may also contain a [`Content-Security-Policy`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP) header that is enforced while processing the early hint. -This allows a browser to start [preloading](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/preload) resources even before the server has prepared and sent that final response. +A server might send multiple `103` responses, for example, following a redirect. Browsers only process the first early hints response, and this response must be discarded if the request results in a cross-origin redirect. -The early hint response is primarily intended for use with the [Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link) header, which indicates the resources to be loaded. +**Note:** For compatibility and security reasons, it is recommended to [only send HTTP `103 Early Hints` responses over HTTP/2 or later](https://www.rfc-editor.org/rfc/rfc8297#section-3) unless the client is known to handle informational responses correctly. -It may also contain a [Content-Security-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) header that is enforced while processing the early hint. +Most browsers limit support to HTTP/2 or later for this reason. See [browser compatibility](#browser_compatibility) below. Despite this, the examples below use HTTP/1.1-style notation as per usual convention. +### Syntax -A server might send multiple `103` responses, for example, following a redirect. -Browsers only process the first early hint response, and this response must be discarded if the request results in a cross-origin redirect. -Preloaded resources from the early hint are effectively pre-pended to the `Document`'s head element, and then followed by the resources loaded in the final response. +http -### See Also + 103 Early Hints + -- [Spec](https://html.spec.whatwg.org/multipage/semantics.html#early-hints) -- [Link Header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link) +### Examples -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/103](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/103) +The following `103` early hint response shows an early hint response where the server indicates that the client might want to preconnect to a particular origin (`https://cdn.example.com`). Just like the HTML [`rel=preconnect`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel/preconnect) attribute, this is a hint that the page is likely to need resources from the target resource's origin, and that the browser may improve the user experience by preemptively initiating a connection to that origin. + +http + + 103 Early Hint + Link: ; rel=preconnect, ; rel=preconnect; crossorigin + + +This example preconnects to `https://cdn.example.com` twice: + +* The first connection would be used for loading resources that can be fetched without CORS, such as images. +* The second connection includes the [`crossorigin`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/crossorigin) attribute and would be used for loading [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS)\-protected resources, such as fonts. + +CORS-protected resources must be fetched over a completely separate connection. If you only need one type of resource from an origin then you only need to preconnect once. + +Subsequently the server sends the final response. This includes a crossorigin font preload and an `` loaded from the additional origin. + +http + + 200 OK + Content-Type: text/html + + + ... + + ... + + ... + + +The following `103` early hint response indicates a stylesheet `style.css` might be needed by the final response. + +http + + 103 Early Hint + Link: ; rel=preload; as=style + + +Subsequently the server sends the final response. This includes a link to the stylesheet, which may already have been preloaded from the early hint. + +http + + 200 OK + Content-Type: text/html + + + ... + + ... + + +The following example shows the same early hint response but with a `Content-Security-Policy` header included. + +http + + 103 Early Hint + Content-Security-Policy: style-src: self; + Link: ; rel=preload; as=style + + +The early response restricts preloading to the same origin as the request. The stylesheet will be preloaded if the origin matches. + +The final response might set the CSP to `none`, as shown below. The stylesheet has already been preloaded, but will not be used when rendering the page. + +http + + 200 OK + Content-Security-Policy: style-src: none; + Content-Type: text/html + + + ... + + ... + + +### Specifications + +Specification + +[An HTTP Status Code for Indicating Hints +\# early-hints](https://httpwg.org/specs/rfc8297.html#early-hints) + +[HTML +\# early-hints](https://html.spec.whatwg.org/multipage/semantics.html#early-hints) + +### Browser compatibility + +### See also + +* [`Link`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Link) +* [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS) +* [Content Security Policy (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP) +* [`rel="preconnect"`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel/preconnect) ([``](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link) attribute) +* [`rel="preload"`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel/preload) ([``](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link) attribute) +* [`fetchpriority`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link#fetchpriority) ([``](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link) attribute) +* [Early Hints update: How Cloudflare, Google, and Shopify are working together to build a faster Internet for everyone](https://blog.cloudflare.com/early-hints-performance/) from the Cloudflare blog + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/103](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/103) diff --git a/content/200.md b/content/200.md index 15dd27fb..5cc7a219 100644 --- a/content/200.md +++ b/content/200.md @@ -1,20 +1,80 @@ ## Description -The HTTP `200 OK` success status response code indicates that the request has succeeded. A 200 response is cacheable by default. +The HTTP **`200 OK`** [successful response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#successful_responses) status code indicates that a request has succeeded. A `200 OK` response is cacheable by default. -The meaning of a success depends on the HTTP request method: +A `200 OK` response has a different meaning and format depending on the HTTP request method. Here's how they vary for different methods: -- `GET`: The resource has been fetched and is transmitted in the message body. -- `HEAD`: The representation headers are included in the response without any message body -- `POST`: The resource describing the result of the action is transmitted in the message body -- `TRACE`: The message body contains the request message as received by the server. +* [`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET): A resource was retrieved by the server and included in the response body. +* [`POST`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/POST): An action succeeded; the response has a message body describing the result. +* [`HEAD`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/HEAD): Identical to `GET`, except there is no message body. +* [`TRACE`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/TRACE): The response has a message body containing the request as received by the server. -The successful result of a `PUT` or a `DELETE` is often not a `200 OK` but a `204 No Content` (or a `201 Created` when the resource is uploaded for the first time). +Although possible, successful [`PUT`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/PUT) or [`DELETE`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/DELETE) requests often do not result in a `200 OK` response. It is more common to see [`201 Created`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/201) if the resource is uploaded or created for the first time, or [`204 No Content`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/204) upon successful deletion of a resource. -### See Also -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.200) -- [HTTP request methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) -- [204 No Content](https://http.cat/status/204) -- [201 Created](https://http.cat/status/201) +### Examples -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200) +In this example, a successful `GET` request to `https://example.com` returns a `200 OK` response. The response includes representation headers and a message body with the HTML content: + +http + + HTTP/1.1 200 OK + Accept-Ranges: bytes + Age: 294510 + Cache-Control: max-age=604800 + Content-Type: text/html; charset=UTF-8 + Date: Fri, 21 Jun 2024 14:18:33 GMT + Etag: "3147526947" + Expires: Fri, 28 Jun 2024 14:18:33 GMT + Last-Modified: Thu, 17 Oct 2019 07:18:26 GMT + Server: ECAcc (nyd/D10E) + X-Cache: HIT + Content-Length: 1256 + + + + + +Assuming a form exists to send data to an endpoint for managing subscriptions at `http://example.com/subscribe`. A `POST` request to subscribe a user may look like the following: + +http + + POST /subscribe HTTP/1.1 + Host: example.com + Content-Type: application/x-www-form-urlencoded + Content-Length: 50 + + name=Brian%20Smith&email=brian.smith%40example.com + + +In this example, a response with a `200 OK` status could look like this: + +http + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "message": "User subscription pending. A confirmation email has been sent.", + "subscription": { + "name": "Brian Smith", + "email": "brian.smith@example.com", + "id": 123, + "feed": "default" + } + } + + +### Specifications + +Specification + +[HTTP Semantics +\# status.200](https://www.rfc-editor.org/rfc/rfc9110#status.200) + +### See also + +* [HTTP request methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods) +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* Glossary: [Idempotent](https://developer.mozilla.org/en-US/docs/Glossary/Idempotent) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/200](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/200) diff --git a/content/201.md b/content/201.md index 78e0a120..a860063e 100644 --- a/content/201.md +++ b/content/201.md @@ -1,19 +1,55 @@ ## Description -The HTTP `201 Created` success status response code indicates that the request has -succeeded and has led to the creation of a resource. +The HTTP **`201 Created`** [successful response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#successful_responses) status code indicates that the HTTP request has led to the creation of a resource. This status code is commonly sent as the result of a [`POST`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/POST) request. -The new resource, or a description -and link to the new resource, is effectively created before the response is sent back -and the newly created items are returned in the body of the message, located at either -the URL of the request, or at the URL in the value of the `Location` header. +The new resource, or a description and link to the new resource, is created before the response is returned. The newly-created items can be returned in the body of the response message, but must be locatable by the **URL of the initiating request** or by the URL in the value of the [`Location`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Location) header provided with the response. -The common use case of this status code is as the result of a `POST` -request. +### Examples -### See Also -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.201) -- [HTTP request methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) +Let's assume there's a REST API for managing users with an endpoint at `http://example.com/users`. In this example, we send a `POST` request with the following body to create a user: +http -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/201](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/201) + POST /users HTTP/1.1 + Host: example.com + Content-Type: application/json + + { + "firstName": "Brian", + "lastName": "Smith", + "email": "brian.smith@example.com" + } + + +After successful user creation, the `201 Created` response will look like this: + +http + + HTTP/1.1 201 Created + Content-Type: application/json + Location: http://example.com/users/123 + + { + "message": "New user created", + "user": { + "id": 123, + "firstName": "Brian", + "lastName": "Smith", + "email": "brian.smith@example.com" + } + } + + +### Specifications + +Specification + +[HTTP Semantics +\# status.201](https://www.rfc-editor.org/rfc/rfc9110#status.201) + +### See also + +* [HTTP request methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods) +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/201](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/201) diff --git a/content/202.md b/content/202.md index 87a8d6c8..ad160c7e 100644 --- a/content/202.md +++ b/content/202.md @@ -1,19 +1,52 @@ ## Description -The HTTP `202 Accepted` -response status code indicates that the request has been accepted for processing, but -the processing has not been completed; in fact, processing may not have started yet. +The HTTP **`202 Accepted`** [successful response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#successful_responses) status code indicates that a request has been accepted for processing, but processing has not been completed or may not have started. The actual processing of the request is not guaranteed; a task or action may fail or be disallowed when a server tries to process it. -The request might or might not eventually be acted upon, as it might be disallowed when -processing actually takes place. +A `202` response is non-committal, meaning there is no way to later send an asynchronous HTTP response to indicate the outcome of the processing. This response code is typically used when the request is handled by another process or server, or when requests are processed in batches. -`202` is non-committal, meaning that there is no way for the HTTP to later send an -asynchronous response indicating the outcome of processing the request. It is intended -for cases where another process or server handles the request, or for batch processing. +### Examples -### See Also -- [Spec](https://httpwg.org/specs/rfc9110.html#status.202) -- [Accept](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept), the header that triggers the `202 Accepted` response +In the following example, we want to kick off an automation process to email dog owners about a pickup task: +http -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202) + POST /tasks HTTP/1.1 + Host: example.com + Content-Type: application/json + + { + "task": "emailDogOwners", + "template": "pickup" + } + + +The response indicates that the request to start a task was accepted for processing. A URL is sent in the response body so the client can track changes to the status of the task: + +http + + HTTP/1.1 202 Accepted + Date: Wed, 26 Jun 2024 12:00:00 GMT + Server: Apache/2.4.1 (Unix) + Content-Type: application/json + + { + "message": "Request accepted. Starting to process task.", + "taskId": "123", + "monitorUrl": "http://example.com/tasks/123/status" + } + + +### Specifications + +Specification + +[HTTP Semantics +\# status.202](https://httpwg.org/specs/rfc9110.html#status.202) + +### See also + +* [`Accept`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept) +* [HTTP request methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods) +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/202](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/202) diff --git a/content/203.md b/content/203.md index 20ad3f43..3b72cc90 100644 --- a/content/203.md +++ b/content/203.md @@ -1,18 +1,50 @@ ## Description -The HTTP `203 Non-Authoritative Information` response -status indicates that the request was successful but the enclosed payload has been -modified by a transforming proxy from that of the origin -server's `200 OK` response. - -The `203` response is similar to the value `214`, -meaning `Transformation Applied`, of the `Warning` header -code, which has the additional advantage of being applicable to responses with any -status code. - -### See Also -- [Spec](https://httpwg.org/specs/rfc9110.html#status.203) -- [Proxy server](https://developer.mozilla.org/en-US/docs/Glossary/Proxy_server) -- [Warning](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Warning), the header that triggers the `203 Non-Authoritative Information` response - -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/203](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/203) +The HTTP **`203 Non-Authoritative Information`** [successful response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#successful_responses) status code indicates that the request was successful, but a _transforming [proxy](https://developer.mozilla.org/en-US/docs/Glossary/Proxy_server)_ has modified the headers or enclosed content from the origin server's [`200`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/200) (`OK`) response. + +The purpose of this status code is to allow transforming proxies to notify clients when changes have been applied to successful responses, since this may impact decisions regarding the content later. Transformations to messages can mean modifications of headers to indicate that a resource is from a mirror or a backup, but may also mean modifying content in a way that are presumed to be desirable to the client. These modifications might include malware filtering, format transcoding, privacy filtering, or other hints to the client about future requests. + +The `203` response is similar to the [`214`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Warning#warning_codes) `Transformation Applied` value of the deprecated [`Warning`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Warning) header, which may be applicable to responses with any status code. + +### Examples + +In this example, a user sends a `GET` request for content with ID `123` to `example.com`. + +http + + GET /comments/123 HTTP/1.1 + Host: example.com + + +A proxy has altered the message based on malware filtering rules for known unsafe attachments. The response content has been modified, replacing the `attachment_url` value to a link with information about the filtering in place: + +http + + HTTP/1.1 203 Non-Authoritative Information + Date: Wed, 26 Jun 2024 12:00:00 GMT + Server: Apache/2.4.1 (Unix) + Content-Type: application/json + Content-Length: 123 + + { + "comment": "Check out my bio!", + "attachment_url": "https://example.com/attachment-unavailable-faq" + } + + +### Specifications + +Specification + +[HTTP Semantics +\# status.203](https://httpwg.org/specs/rfc9110.html#status.203) + +### See also + +* [`200`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/200) +* [Proxy server](https://developer.mozilla.org/en-US/docs/Glossary/Proxy_server) +* [`Warning`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Warning) +* [HTTP request methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods) +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/203](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/203) diff --git a/content/204.md b/content/204.md index 8aff23f8..378234ad 100644 --- a/content/204.md +++ b/content/204.md @@ -1,19 +1,71 @@ ## Description -The HTTP `204 No Content` success status response code -indicates that a request has succeeded, but that the client doesn't need to navigate away -from its current page. +The HTTP **`204 No Content`** [successful response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#successful_responses) status code indicates that a request has succeeded, but the client doesn't need to navigate away from its current page. A `204` response is cacheable by default, and an [`ETag`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/ETag) header is included in such cases. +A `204 No Content` in response to these request methods has the following meaning and results: -This might be used, for example, when implementing "save and continue editing" functionality for a wiki site. -In this case a `PUT` request would be used to save the page, and the `204 No Content` response -would be sent to indicate that the editor should not be replaced by some other page. +* [`DELETE`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/DELETE): The action was successful, and no further information needs to be supplied. +* [`PUT`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/PUT): The action was successful, and the [`ETag`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/ETag) value contains the entity tag for the new representation of that target resource. -A `204` response is cacheable by default (an `ETag` header is included in such a response). +A `204` response can be used when implementing "save and continue editing" functionality for applications like wiki sites. In this case, a [`PUT`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/PUT) request could be used to save the page contents, and a `204 No Content` response indicates to the browser that the editor should not be replaced by other content. -### See Also -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.204) -- [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag), the header that allows caches to validate cached responses -- [HTTP request methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) +Note that the response must not include any content or the [`Content-Length`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Length) header (browsers may reject responses that include content). -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/204](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/204) +### Examples + +In this example, the client sends a request to delete an image using the `DELETE` method. The request includes an [`Authorization`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Authorization) header with a token to authenticate the request: + +http + + DELETE /image/123 HTTP/1.1 + Host: example.com + Authorization: Bearer 1234abcd + + +After successfully deleting the image, the server responds with a `204` response with no body, indicating no further information needs to be sent to the client. + +http + + HTTP/1.1 204 No Content + Date: Wed, 26 Jun 2024 12:00:00 GMT + Server: Apache/2.4.1 (Unix) + + +In this example, the client sends a `PUT` request to update a user's profile information. The request includes an [`Authorization`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Authorization) header with a token to authenticate the request: + +http + + PUT /users/123 HTTP/1.1 + Host: example.com + Content-Type: application/json + Authorization: Bearer 1234abcd + + { + "name": "Jane Doe", + "email": "jane@example.com" + } + + +After successfully updating the user profile, the server responds with a `204` response. The [`ETag`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/ETag) header contains the entity tag for the updated resource: + +http + + HTTP/1.1 204 No Content + Date: Wed, 26 Jun 2024 12:00:00 GMT + ETag: "33a64df551425fcc55e4d42a148795d9f25f89d4" + Server: Apache/2.4.1 (Unix) + + +### Specifications + +Specification + +[HTTP Semantics +\# status.204](https://www.rfc-editor.org/rfc/rfc9110#status.204) + +### See also + +* [HTTP request methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods) +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/204](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/204) diff --git a/content/205.md b/content/205.md index 5f28a448..2cf3559d 100644 --- a/content/205.md +++ b/content/205.md @@ -1,9 +1,48 @@ ## Description -The HTTP `205 Reset Content` response status tells the client to reset the document view (ie. clear the content of a form, reset canvas state or the UI). +The HTTP **`205 Reset Content`** [successful response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#successful_responses) status code indicates that the request has been successfully processed and the client should reset the document view. -### See Also -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.205) -- [204 No Content](https://http.cat/status/204) +This response is intended to support use cases where the user receives content that supports data entry, submits user-edited data in a request, and the content needs to be reset for the next entry. The instruction to "reset content" can mean clearing the contents of a form, resetting a canvas state, or refreshing a UI; the implementation depends on the client. -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/205](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/205) +**Note:** In web applications that use the `205` status, it's assumed that the client handles resetting content after a `205` response. This is typically done via JavaScript, as resetting content such as forms after a `205` response is not handled natively by browsers. + +Note that the response must not include any content or the [`Content-Length`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Length) header (browsers may reject responses that include content). The empty response may also be indicated using the [`Transfer-Encoding: chunked`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Transfer-Encoding) header with an empty chunk. + +### Examples + +The client in this example sends a `POST` request to submit a form with the comment `Hello!`: + +http + + POST /submit HTTP/1.1 + Host: example.com + Content-Type: application/x-www-form-urlencoded + Content-Length: 15 + + comment=Hello! + + +After successfully processing the form submission, the server responds with the following `205` response, indicating that the client should reset the form. + +http + + HTTP/1.1 205 Reset Content + Content-Type: text/html; charset=utf-8 + Content-Length: 0 + Date: Wed, 26 Jun 2024 12:00:00 GMT + + +### Specifications + +Specification + +[HTTP Semantics +\# status.205](https://www.rfc-editor.org/rfc/rfc9110#status.205) + +### See also + +* [`204`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/204) No Content +* [HTTP request methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods) +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/205](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/205) diff --git a/content/206.md b/content/206.md index 01aed722..b660c0b5 100644 --- a/content/206.md +++ b/content/206.md @@ -1,22 +1,80 @@ ## Description -The HTTP `206 Partial Content` success status response code -indicates that the request has succeeded and the body contains the requested ranges -of data, as described in the Range header of the request. +The HTTP **`206 Partial Content`** [successful response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#successful_responses) status code is sent in response to a [range request](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Range_requests). The response body contains the requested ranges of data as specified in the [`Range`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Range) header of the request. -If there is only one range, the `Content-Type` of the whole response is -set to the type of the document, and a `Content-Range` is provided. +The format of the response depends on the number of ranges requested. If a single range is requested, the [`Content-Type`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Type) of the entire response is set to the type of the document, and a [`Content-Range`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Range) is provided. If several ranges are requested, the [`Content-Type`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Type) is set to `multipart/byteranges`, and each fragment covers one range, with its own [`Content-Range`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Range) and [`Content-Type`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Type) headers describing it. -If several ranges are sent back, the `Content-Type` is set to -`multipart/byteranges` and each fragment covers one range, with -`Content-Range` and `Content-Type` describing it. +### Examples -### See Also -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.206) -- [If-Range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Range), a header that determines how to send ranges only if they have changed -- [Range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range), a header that determines the range request of the body in the response -- [Content-Range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range), a header describing the content of the body -- [Content-Type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type), the header that indicates the media type of the resource +The following is a sample `206` response when a single range of `21010-` (bytes 21010 to the end of file) of an image file is requested. The response contains [`Content-Type`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Type) of `image/gif` and the [`Content-Range`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Range) is provided: +http -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206) + GET /z4d4kWk.gif HTTP/1.1 + Host: images.example.com + Range: bytes=21010- + + +http + + HTTP/1.1 206 Partial Content + Date: Wed, 15 Nov 2015 06:25:24 GMT + Last-Modified: Wed, 15 Nov 2015 04:58:08 GMT + Content-Range: bytes 21010-47021/47022 + Content-Length: 26012 + Content-Type: image/gif + ETag: "abc123" + Accept-Ranges: bytes + + # 26012 bytes of partial image data… + + +Following is a sample `206` response when two ranges of a PDF file are requested. The response contains the `multipart/byteranges` [`Content-Type`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Type) with a separate [`Content-Type`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Type) (`application/pdf`) and [`Content-Range`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Range) for each range. + +http + + GET /price-list.pdf HTTP/1.1 + Host: example.com + Range: bytes=234-639,4590-7999 + + +http + + HTTP/1.1 206 Partial Content + Date: Wed, 15 Nov 2015 06:25:24 GMT + Last-Modified: Wed, 15 Nov 2015 04:58:08 GMT + Content-Length: 1741 + Content-Type: multipart/byteranges; boundary=String_separator + ETag: "abc123" + Accept-Ranges: bytes + + --String_separator + Content-Type: application/pdf + Content-Range: bytes 234-639/8000 + + # content of first range (406 bytes) + --String_separator + Content-Type: application/pdf + Content-Range: bytes 4590-7999/8000 + + # content of second range (3410 bytes) + --String_separator-- + + +### Specifications + +Specification + +[HTTP Semantics +\# status.206](https://www.rfc-editor.org/rfc/rfc9110#status.206) + +### See also + +* [`If-Range`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-Range) +* [`Range`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Range) +* [`Content-Range`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Range) +* [`Content-Type`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Type) +* [HTTP request methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods) +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/206](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/206) diff --git a/content/207.md b/content/207.md index 30b44b62..c4fa08af 100644 --- a/content/207.md +++ b/content/207.md @@ -1,19 +1,62 @@ ## Description -The HTTP `207 Multi-Status` response code indicates that there might be a mixture of responses. +The HTTP **`207 Multi-Status`** [successful response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#successful_responses) status code indicates a mixture of responses. This response is used exclusively in the context of Web Distributed Authoring and Versioning ([WebDAV](https://developer.mozilla.org/en-US/docs/Glossary/WebDAV)). -The response body is a `text/xml` or `application/xml` HTTP entity with a `multistatus` root element. The XML body will list all individual response codes. +The response body is a `text/xml` or `application/xml` HTTP entity with a `multistatus` root element that lists individual response codes. +**Note:** Browsers accessing web pages will never encounter this status code. The ability to return a _collection of resources_ is part of the [WebDAV](https://developer.mozilla.org/en-US/docs/Glossary/WebDAV) protocol and is only encountered by web applications that access a WebDAV server. - - - ### See Also - - [Spec](https://www.rfc-editor.org/rfc/rfc4918#section-11.1) - - [WebDAV](https://developer.mozilla.org/en-US/docs/Glossary/WebDAV) - - [HTTP request methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) - - [204 No Content](https://http.cat/status/204) - - [403 Forbidden](https://http.cat/status/403) +### Examples +The following response is an example `207` response that a [WebDAV](https://developer.mozilla.org/en-US/docs/Glossary/WebDAV) server sends to a client. There is a `multistatus` root element with details of the individual collections: - **Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/207](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/207) +http + + HTTP/1.1 207 Multi-Status + Content-Type: application/xml; charset="utf-8" + Content-Length: 1241 + + + + + http://www.example.com/Coll/ + + + Loop Demo + + urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf8 + + + HTTP/1.1 200 OK + + + + http://www.example.com/Coll/Bar + + + Loop Demo + + urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf8 + + + HTTP/1.1 208 Already Reported + + + + + +### Specifications + +Specification + +[RFC 4918 +\# section-11.1](https://www.rfc-editor.org/rfc/rfc4918#section-11.1) + +### See also + +* [`204`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/204) +* [`403`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/403) +* [HTTP request methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods) +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/207](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/207) diff --git a/content/208.md b/content/208.md index 8498ead8..0e03482b 100644 --- a/content/208.md +++ b/content/208.md @@ -1,12 +1,74 @@ ## Description -The HTTP `208 Already Reported` response status is used in a [207 Multi-Status](https://http.cat/status/207) response to save space and avoid conflicts. If the same resource is requested several times (for example as part of a collection), with different paths, only the first one is reported with [200](https://http.cat/status/200). Responses for all other bindings will report with this 208 status code, so no conflicts are created and the response stays shorter. +The HTTP **`208 Already Reported`** [successful response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#successful_responses) status code is used in a [`207 Multi-Status`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/207) response to save space and avoid conflicts. This response is used exclusively in the context of Web Distributed Authoring and Versioning ([WebDAV](https://developer.mozilla.org/en-US/docs/Glossary/WebDAV)). - +If the same resource is requested several times (for example, as part of a collection) with different paths, only the first one is reported with [`200`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/200). Responses for all other bindings will report with this `208` status code, so no conflicts are created and the response stays shorter. -### See Also -- [Spec](https://www.rfc-editor.org/rfc/rfc5842.html#section-7.1) -- [200 OK](https://http.cat/status/200) -- [WebDAV](https://developer.mozilla.org/en-US/docs/Glossary/WebDAV) +**Note:** The ability to _bind_ a resource to several paths is an extension to the [WebDAV](https://developer.mozilla.org/en-US/docs/Glossary/WebDAV) protocol (it may be received by web applications accessing a WebDAV server). Browsers accessing web pages will never encounter this status code. -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/208](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/208) +### Examples + +The following is a sample `207 Multi-Status` response from a WebDAV server, which includes a `208` response. Notice the `208` in the last `` element, which indicates that the resource named `Loop Demo` has been reported earlier in the `207` response. + +http + + HTTP/1.1 207 Multi-Status + Content-Type: application/xml; charset="utf-8" + Content-Length: 1241 + + + + + http://www.example.com/Coll/ + + + Loop Demo + + urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf8 + + + HTTP/1.1 200 OK + + + + http://www.example.com/Coll/Foo + + + Bird Inventory + + urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf9 + + + HTTP/1.1 200 OK + + + + http://www.example.com/Coll/Bar + + + Loop Demo + + urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf8 + + + HTTP/1.1 208 Already Reported + + + + + +### Specifications + +Specification + +[Unknown specification +\# section-7.1](https://www.rfc-editor.org/rfc/rfc5842.html#section-7.1) + +### See also + +* [`200`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/200) +* [`508 Loop Detected`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/508) +* [HTTP request methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods) +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/208](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/208) diff --git a/content/226.md b/content/226.md index 02aa0f4e..b0476237 100644 --- a/content/226.md +++ b/content/226.md @@ -1,13 +1,51 @@ ## Description -The HTTP `226 IM Used` response status, in the context of delta encodings, is a status code set by the server to indicate that it is returning a delta to the GET request that it received. IM stands for *Instance Manipulations*, the term used to describe an algorithm generating a delta. +The HTTP **`226 IM Used`** [successful response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#successful_responses) status code indicates that the server is returning a [delta](https://developer.mozilla.org/en-US/docs/Glossary/Delta) in response to a [`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET) request. It is used in the context of _HTTP delta encodings_. -With delta encoding a server responds to `GET` requests with differences (called deltas) relative to a given base document (rather than the current document). The client uses the `A-IM:` HTTP header to indicate which differencing algorithm to use and the `If-None-Match:` header to hint the server about the last version it got. The server generates a delta, sending it back in an HTTP response with the `226` status code and containing the `IM:` (with the name of the algorithm used) and `Delta-Base:` (with the `ETag` matching the base document associated to the delta) HTTP headers. +IM stands for _instance manipulation_, which refers to the algorithm generating a _delta_. In delta encoding, a client sends a [`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET) request with two headers: `A-IM:`, which indicates a preference for a differencing algorithm, and [`If-None-Match`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-None-Match), which specifies the version of a resource it has. The server responds with deltas relative to a given base document, rather than the document in full. This response uses the `226` status code, an `IM:` header that describes the differencing algorithm used, and may include a `Delta-Base:` header with the [`ETag`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/ETag) matching the base document associated to the delta. - +**Warning:** Poor support for HTTP delta encodings means there are few implementations. Instead, most systems rely solely on [compression methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Compression) to reduce bandwidth, although a combination of compression and delta encodings is possible. -### See Also -- [Spec](https://www.rfc-editor.org/rfc/rfc5842.html#section-7.1) -- [HTTP Headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers) +Even if the client and server support delta encodings, proxies or caches may not, and the complexity of adding HTTP delta encodings to a system may outweigh the benefits. -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/226](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/226) +### Examples + +In the following `GET` request, a client requests a resource and has a cached version with the ETag `abcd123`. The `A-IM:` header indicates a preference for `vcdiff` and `diffe` delta algorithms: + +http + + GET /resource.txt HTTP/1.1 + Host: example.com + A-IM: vcdiff, diffe + If-None-Match: "abcd123" + + +Assuming the server supports delta encodings, it responds with the diff since the version with the ETag `abcd123`. The `IM` header indicates that the `vcdiff` algorithm is used, and the `Delta-Base:` header indicates that the diff is based on a resource with ETag `abcd123`. + +http + + HTTP/1.1 226 IM Used + ETag: "5678a23" + IM: vcdiff + Content-Type: text/plain + Content-Length: 123 + Delta-Base: abcd123 + + ... + + +### Specifications + +Specification + +[Unknown specification +\# section-10.4.1](https://www.rfc-editor.org/rfc/rfc3229.html#section-10.4.1) + +### See also + +* [`200`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/200) +* [HTTP request methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods) +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [Syndication feed deltas help reduce subscription bandwidth costs](https://www.ctrl.blog/entry/feed-delta-updates.html) (2017) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/226](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/226) diff --git a/content/300.md b/content/300.md index 8ff4b5b0..c7d6954c 100644 --- a/content/300.md +++ b/content/300.md @@ -1,19 +1,85 @@ ## Description -The HTTP `300 Multiple Choices` redirect status response code indicates that the request has more than one possible response. +The HTTP **`300 Multiple Choices`** [redirection response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#redirection_messages) status code indicates that the request has more than one possible response. The user-agent or the user should choose one of them. -The user-agent or the user should choose one of them. +**Note:** In [agent-driven content negotiation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Content_negotiation#agent-driven_negotiation), a client and server collaboratively decide the best variant of a given resource when the server has multiple variants. Most clients lack a method for automatically choosing from responses, and the additional round-trips slow down client-server interaction. [Server-driven content negotiation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Content_negotiation#server-driven_content_negotiation) is far more common, where a server chooses the most appropriate resource for the client based on the request headers ([`Accept-Language`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept-Language), [`Accept`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept), etc.). -As there is no standardized way of choosing one of the responses, this response code is very rarely used. +The server should include content in the response that contains a list of resource metadata and URIs from which the user or user agent can choose. The format of the content is implementation-specific, but should be easily parsed by the user agent (such as HTML or JSON). -If the server has a preferred choice, it should generate a `Location` header. +If the server has a preferred choice that the client should request, it can include it in a [`Location`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Location) header. -### See Also +### Examples -- [Spec](https://httpwg.org/specs/rfc9110.html#status.300) -- [Location](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Location), the header indicating where to find the preferred response -- [301 Moved Permanently](https://http.cat/status/301) -- [302 Found](https://http.cat/status/302) -- [308 Permanent Redirect](https://http.cat/status/308) +The following example demonstrates a Transparent Content Negotiation request-response exchange. An Apache server offers multiple variants of a resource defined in a [type map](https://httpd.apache.org/docs/trunk/mod/mod_negotiation.html#typemaps); `index.html.en` for a resource in English, and `index.html.fr` for a French version: -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/300](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/300) +http + + URI: index.html.en + Content-Language: en + + URI: index.html.fr + Content-Language: fr + + +A `Negotiate: trans` request header indicates that the client wants to use TCN to choose a resource. Poor browser support for this mechanism means a user agent such as curl must be used instead: + +bash + + curl -v -H "Negotiate: trans" http://localhost/index + + +This produces the following request: + +http + + GET /index HTTP/1.1 + Host: localhost + User-Agent: curl/8.7.1 + Accept: */* + Negotiate: trans + + +We receive a `300` response with details of different representations of the requested resource: + +http + + HTTP/1.1 300 Multiple Choices + Date: Fri, 30 Aug 2024 09:21:48 GMT + Server: Apache/2.4.59 (Unix) + Alternates: {"index.html.en" 1 {type text/html} {language en} {length 48}}, {"index.html.fr" 1 {type text/html} {language fr} {length 45}} + Vary: negotiate,accept-language + TCN: list + Content-Length: 419 + Content-Type: text/html; charset=iso-8859-1 + + + 300 Multiple Choices + +

Multiple Choices

+ Available variants: + + + + +### Specifications + +Specification + +[HTTP Semantics +\# status.300](https://httpwg.org/specs/rfc9110.html#status.300) + +### See also + +* [Redirections in HTTP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Redirections) +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`301 Moved Permanently`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/301) +* [`302 Found`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/302) temporary redirect +* [`308 Permanent Redirect`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/308) +* [`506 Variant Also Negotiates`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/506) +* [Apache Server Negotiation Algorithm](https://httpd.apache.org/docs/current/en/content-negotiation.html#algorithm) +* [RFC 2295: Transparent Content Negotiation in HTTP](https://datatracker.ietf.org/doc/html/rfc2295) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/300](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/300) diff --git a/content/301.md b/content/301.md index f78cd411..855f8531 100644 --- a/content/301.md +++ b/content/301.md @@ -1,13 +1,49 @@ ## Description -The HTTP `301 Moved Permanently` redirect status response code indicates that the requested resource has been definitively moved to the URL given by the `Location` headers. A browser redirects to the new URL and search engines update their links to the resource. +The HTTP **`301 Moved Permanently`** [redirection response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#redirection_messages) status code indicates that the requested resource has been permanently moved to the URL in the [`Location`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Location) header. - +A browser receiving this status will automatically request the resource at the URL in the `Location` header, redirecting the user to the new page. Search engines receiving this response will attribute links to the original URL to the redirected resource, passing the [SEO](https://developer.mozilla.org/en-US/docs/Glossary/SEO) ranking to the new URL. -### See Also +**Note:** In the [Fetch Standard](https://fetch.spec.whatwg.org/#http-redirect-fetch), when a user agent receives a `301` in response to a [`POST`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/POST) request, it uses the [`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET) method in the subsequent redirection request, as permitted by the HTTP [specification](#specifications). To avoid user agents modifying the request, use [`308 Permanent Redirect`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/308) instead, as altering the method after a `308` response is prohibited. -- [Spec](https://httpwg.org/specs/rfc9110.html#status.301) -- [308 Permanent Redirect](https://http.cat/status/308) -- [302 Found](https://http.cat/status/302) +### Examples -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/301](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/301) +The following [`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET) request is made to a resource with a `301` redirection in place. + +http + + GET /en-US/docs/AJAX HTTP/2 + Host: developer.mozilla.org + User-Agent: curl/8.6.0 + Accept: */* + + +The response includes the `301` status along with the [`Location`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Location) header that indicates the URL where the resource has moved. + +http + + HTTP/2 301 + cache-control: max-age=2592000,public + location: /en-US/docs/Learn_web_development/Core/Scripting/Network_requests + content-type: text/plain; charset=utf-8 + date: Fri, 19 Jul 2024 12:57:17 GMT + content-length: 97 + + Moved Permanently. Redirecting to /en-US/docs/Learn_web_development/Core/Scripting/Network_requests + + +### Specifications + +Specification + +[HTTP Semantics +\# status.301](https://www.rfc-editor.org/rfc/rfc9110#status.301) + +### See also + +* [Redirections in HTTP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Redirections) +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`308 Permanent Redirect`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/308) equivalent to `301`, but the request method is not modified +* [`302 Found`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/302) temporary redirect + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/301](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/301) diff --git a/content/302.md b/content/302.md index 13b63314..ae66ae12 100644 --- a/content/302.md +++ b/content/302.md @@ -1,28 +1,42 @@ ## Description -The HTTP `302 Found` redirect -status response code indicates that the resource requested has been temporarily moved to -the URL given by the `Location` header. A browser redirects to this page -but search engines don't update their links to the resource (in 'SEO-speak', it is said -that the 'link-juice' is not sent to the new URL). - -Even if the specification requires the method (and the body) not to be altered when the -redirection is performed, not all user-agents conform here - you can still find this -type of bugged software out there. It is therefore recommended to set the -`302` code only as a response for `GET` or -`HEAD` methods and to use `307 Temporary Redirect` instead, as the method change -is explicitly prohibited in that case. - -In the cases where you want the method used to be changed to `GET`, use -`303 See Other` instead. This is useful when you want to give a -response to a `PUT` method that is not the uploaded resource but a -confirmation message such as: 'you successfully uploaded XYZ'. - -### See Also - -- [Spec](https://httpwg.org/specs/rfc9110.html#status.302) -- [307 Temporary Redirect](https://http.cat/status/307) -- [301 Moved Permanently](https://http.cat/status/301) -- [303 See Other](https://http.cat/status/303) - -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302) +The HTTP **`302 Found`** [redirection response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#redirection_messages) status code indicates that the requested resource has been temporarily moved to the URL in the [`Location`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Location) header. + +A browser receiving this status will automatically request the resource at the URL in the `Location` header, redirecting the user to the new page. Search engines receiving this response will not attribute links to the original URL to the new resource, meaning no [SEO](https://developer.mozilla.org/en-US/docs/Glossary/SEO) value is transferred to the new URL. + +**Note:** In the [Fetch Standard](https://fetch.spec.whatwg.org/#http-redirect-fetch), when a user agent receives a `302` in response to a [`POST`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/POST) request, it uses the [`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET) method in the subsequent redirection request, as permitted by the HTTP [specification](#specifications). To avoid user agents modifying the request, use [`307 Temporary Redirect`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/307) instead, as altering the method after a `307` response is prohibited. + +In cases where you want any request method to be changed to [`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET), use [`303 See Other`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/303). This is useful when you want to give a response to a [`PUT`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/PUT) method that is not the uploaded resource but a confirmation message such as: "you successfully uploaded XYZ". + +### Examples + +http + + GET /profile HTTP/1.1 + Host: www.example.com + + +http + + HTTP/1.1 302 Found + Location: https://www.example.com/new-profile-url + Content-Type: text/html; charset=UTF-8 + Content-Length: 0 + + +### Specifications + +Specification + +[HTTP Semantics +\# status.302](https://www.rfc-editor.org/rfc/rfc9110#status.302) + +### See also + +* [Redirections in HTTP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Redirections) +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`307 Temporary Redirect`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/307), equivalent to `302` but the request method is not modified +* [`303 See Other`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/303), a temporary redirect that changes the method to [`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET) +* [`301 Moved Permanently`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/301), a permanent redirect. + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/302](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/302) diff --git a/content/303.md b/content/303.md index be15e390..13a6950e 100644 --- a/content/303.md +++ b/content/303.md @@ -1,18 +1,45 @@ ## Description -The HTTP `303 See Other` -redirect status response code indicates that the redirects don't link to the requested resource itself, but to another page (such as a confirmation page, a representation of a real-world object — see [HTTP range-14](https://en.wikipedia.org/wiki/HTTPRange-14) — or an upload-progress page). +The HTTP **`303 See Other`** [redirection response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#redirection_messages) status code indicates that the browser should redirect to the URL in the [`Location`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Location) header instead of rendering the requested resource. -This response code is often sent back as a result of -`PUT` or `POST`. +This response code is often sent back as a result of [`PUT`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/PUT) or [`POST`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/POST) methods so the client may retrieve a confirmation, or view a representation of a real-world object (see [HTTP range-14](https://en.wikipedia.org/wiki/HTTPRange-14)). The method to retrieve the redirected resource is always [`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET). -The method used to display this redirected page is always `GET`. +### Examples -### See Also +The client in this example sends a [`POST`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/POST) request to submit a form to a generic subscription. -- [Spec](https://httpwg.org/specs/rfc9110.html#status.303) -- [302 Found](https://http.cat/status/302) -- [307 Temporary Redirect](https://http.cat/status/307) -- [HTTP range-14](https://en.wikipedia.org/wiki/HTTPRange-14) +http -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/303](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/303) + POST /subscribe HTTP/1.1 + Host: example.com + Content-Type: application/x-www-form-urlencoded + Content-Length: 50 + + name=Brian%20Smith&email=brian.smith%40example.com + + +The server may send back a response with a `303` status and a confirmation page in the [`Location`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Location) header, so the user is redirected there after receiving the response. + +http + + HTTP/1.1 303 See Other + Location: https://www.example.com/confirmation/event/123 + Content-Type: text/html; charset=UTF-8 + Content-Length: 0 + + +### Specifications + +Specification + +[HTTP Semantics +\# status.303](https://www.rfc-editor.org/rfc/rfc9110#status.303) + +### See also + +* [Redirections in HTTP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Redirections) +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`302 Found`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/302), a temporary redirect +* [`307 Temporary Redirect`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/307), a temporary redirect where the request method is not modified + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/303](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/303) diff --git a/content/304.md b/content/304.md index 831bedeb..1a04d21f 100644 --- a/content/304.md +++ b/content/304.md @@ -1,25 +1,109 @@ ## Description -The HTTP `304 Not Modified` client redirection response -code indicates that there is no need to retransmit the requested resources. It is an -implicit redirection to a cached resource. This happens when the request method is -a safe method, such as `GET` or `HEAD`, -or when the request is conditional and uses an `If-None-Match` or an -`If-Modified-Since` header. +The HTTP **`304 Not Modified`** [redirection response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#redirection_messages) status code indicates that there is no need to retransmit the requested resources. -The response must not contain a body and must include the headers that would -have been sent in an equivalent `200 OK` response: -`Cache-Control`, `Content-Location`, `Date`, `ETag`, `Expires`, and `Vary`. +This response code is sent when the request is a [conditional](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Conditional_requests) [`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET) or [`HEAD`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/HEAD) request with an [`If-None-Match`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-None-Match) or an [`If-Modified-Since`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-Modified-Since) header and the condition evaluates to 'false'. It confirms that the resource cached by the client is still valid and that the server would have sent a [`200 OK`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/200) response with the resource if the condition evaluated to 'true'. See [HTTP caching](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching) for more information. - +The response must not contain a body and must include the headers that would have been sent in an equivalent [`200`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/200) response, such as: -### See Also +* [`Cache-Control`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cache-Control) +* [`Content-Location`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Location) +* [`Date`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Date) +* [`ETag`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/ETag) +* [`Expires`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Expires) +* [`Vary`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Vary) -- [Spec](https://httpwg.org/specs/rfc9110.html#status.304) -- [If-Modified-Since](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since), the header that triggers the `304 Not Modified` response -- [If-None-Match](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match), the header that triggers the `304 Not Modified` response -- [204 No Content](https://http.cat/status/204) +**Note:** Many [developer tools' network panels](https://firefox-source-docs.mozilla.org/devtools-user/network_monitor/index.html) of browsers create extraneous requests leading to `304` responses, so that access to the local cache is visible to developers. -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/304](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/304) +### Examples + +The examples below show [`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET) requests made using [curl](https://curl.se/) with conditional request headers. The `--http1.1` flag is used to force the HTTP/1.1 protocol for readability. + +The first request uses an `If-Modified-Since` condition with a future date of 21st November 2050. This must evaluate to `false`, because the resource can't have been updated after a time that hasn't happened yet: + +bash + + curl --http1.1 -I --header 'If-Modified-Since: Tue, 21 Nov 2050 08:00:00 GMT' \ + https://developer.mozilla.org/en-US/ + + +This will result in the following HTTP request: + +http + + GET /en-US/ HTTP/1.1 + Host: developer.mozilla.org + User-Agent: curl/8.7.1 + Accept: */* + If-Modified-Since: Tue, 21 Nov 2050 08:00:00 GMT + + +The response would be [`200 OK`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/200) with the current version of the resource if the resource had been updated after the timestamp in the [`If-Modified-Since`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-Modified-Since) header. Instead, we get a `304` response that includes [`ETag`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/ETag), [`Age`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Age) and [`Expires`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Expires) headers, telling us our cached version of the resource is still current: + +http + + HTTP/1.1 304 Not Modified + Date: Wed, 28 Aug 2024 09:52:35 GMT + Expires: Wed, 28 Aug 2024 10:01:53 GMT + Age: 3279 + ETag: "b20a0973b226eeea30362acb81f9e0b3" + Cache-Control: public, max-age=3600 + Vary: Accept-Encoding + X-cache: hit + Alt-Svc: clear + + +Now run another `curl` command using the `etag` value from the previous response with the [`If-None-Match`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-None-Match) condition (since this `etag` is the current version of the resource on the server we expect to receive a `304 Not Modified` response): + +bash + + curl --http1.1 -I --header 'If-None-Match: "b20a0973b226eeea30362acb81f9e0b3"' \ + https://developer.mozilla.org/en-US/ + + +This will result in the following HTTP request: + +http + + GET /en-US/ HTTP/1.1 + Host: developer.mozilla.org + User-Agent: curl/8.7.1 + Accept: */* + If-None-Match: "b20a0973b226eeea30362acb81f9e0b3" + + +Because the `etag` value matches at the time of the request, the entity tag fails the condition, and a `304` response is returned: + +http + + HTTP/1.1 304 Not Modified + Date: Wed, 28 Aug 2024 10:36:35 GMT + Expires: Wed, 28 Aug 2024 11:02:17 GMT + Age: 662 + ETag: "b20a0973b226eeea30362acb81f9e0b3" + Cache-Control: public, max-age=3600 + Vary: Accept-Encoding + X-cache: hit + Alt-Svc: clear + + +### Specifications + +Specification + +[HTTP Semantics +\# status.304](https://www.rfc-editor.org/rfc/rfc9110#status.304) + +### Compatibility notes + +Browser behavior differs if this response erroneously includes a body on persistent connections. See [`204 No Content`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/204) for more details. + +### See also + +* [Redirections in HTTP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Redirections) +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [HTTP conditional requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Conditional_requests) +* [`If-Modified-Since`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-Modified-Since) +* [`If-None-Match`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-None-Match) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/304](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/304) diff --git a/content/307.md b/content/307.md index da084f36..1d0a6ac8 100644 --- a/content/307.md +++ b/content/307.md @@ -1,26 +1,46 @@ ## Description -HTTP `307 Temporary Redirect` redirect -status response code indicates that the resource requested has been temporarily moved to -the URL given by the `Location` headers. - -The method and the body of the original request are reused to perform the redirected -request. In the cases where you want the method used to be changed to -`GET`, use `303 See Other` instead. This is -useful when you want to give an answer to a `PUT` method that is not the -uploaded resources, but a confirmation message (like "You successfully uploaded XYZ"). - -The only difference between `307` and `302` is that -`307` guarantees that the method and the body will not be changed when the -redirected request is made. With `302`, some old clients were incorrectly -changing the method to `GET`: the behavior with non-GET -methods and `302` is then unpredictable on the Web, whereas the behavior with -`307` is predictable. For `GET` requests, their behavior is identical. - -### See Also -- [Spec](https://httpwg.org/specs/rfc9110.html#status.307) -- [302 Found](https://http.cat/status/302) -- [301 Moved Permanently](https://http.cat/status/301) -- [303 See Other](https://http.cat/status/303) - -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/307](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/307) +The HTTP **`307 Temporary Redirect`** [redirection response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#redirection_messages) status code indicates that the resource requested has been temporarily moved to the URL in the [`Location`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Location) header. + +A browser receiving this status will automatically request the resource at the URL in the `Location` header, redirecting the user to the new page. Search engines receiving this response will not attribute links to the original URL to the new resource, meaning no [SEO](https://developer.mozilla.org/en-US/docs/Glossary/SEO) value is transferred to the new URL. + +The method and the body of the original request are reused to perform the redirected request. In the cases where you want the request method to be changed to [`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET), use [`303 See Other`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/303) instead. This is useful when you want to give an answer to a successful [`PUT`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/PUT) request that is not the uploaded resource, but a status monitor or confirmation message like "You have successfully uploaded XYZ". + +The difference between `307` and [`302`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/302) is that `307` guarantees that the client **will not change** the request method and body when the redirected request is made. With `302`, older clients incorrectly changed the method to [`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET). `307` and `302` responses are identical when the request method is [`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET). + +### Examples + +The following [`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET) request to is made to a resource that has a `307` redirection in place. The [`Location`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Location) header provides the URL of the redirected resource. + +http + + GET /en-US/docs/AJAX HTTP/2 + Host: developer.mozilla.org + User-Agent: curl/8.6.0 + Accept: */* + + +http + + HTTP/2 307 + location: /en-US/docs/Learn_web_development/Core/Scripting/Network_requests + content-type: text/plain; charset=utf-8 + date: Fri, 19 Jul 2024 12:57:17 GMT + + +### Specifications + +Specification + +[HTTP Semantics +\# status.307](https://www.rfc-editor.org/rfc/rfc9110#status.307) + +### See also + +* [Redirections in HTTP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Redirections) +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`302 Found`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/302), the equivalent to `307`, but may modify non-[`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET) methods +* [`303 See Other`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/303), temporary redirect that modifies the request method to [`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET) +* [`301 Moved Permanently`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/301), a permanent redirect + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/307](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/307) diff --git a/content/308.md b/content/308.md index b711e101..4276db2c 100644 --- a/content/308.md +++ b/content/308.md @@ -1,23 +1,42 @@ ## Description -The HTTP `308 Permanent Redirect` redirect status response code -indicates that the resource requested has been definitively moved to the URL given by -the `Location` headers. A browser redirects to this page and search -engines update their links to the resource (in 'SEO-speak', it is said that the -'link-juice' is sent to the new URL). +The HTTP **`308 Permanent Redirect`** [redirection response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#redirection_messages) status code indicates that the requested resource has been permanently moved to the URL given by the [`Location`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Location) header. -The request method and the body will not be altered, whereas `301` may -incorrectly sometimes be changed to a `GET` method. +A browser receiving this status will automatically request the resource at the URL in the `Location` header, redirecting the user to the new page. - +The request method and the body **will not be modified** by the client in the redirected request. A [`301 Moved Permanently`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/301) requires the request method and the body to remain unchanged when redirection is performed, but this is incorrectly handled by older clients to use the [`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET) method instead. -### See Also +**Note:** Some Web applications may use the `308 Permanent Redirect` in a non-standard way and for different purposes. For example, Google Drive uses a `308 Resume Incomplete` response to indicate to the client when an unfinished upload has stalled. See [Perform a resumable download](https://developers.google.com/workspace/drive/api/guides/manage-uploads) on the Google Drive documentation for more information. -- [Spec](https://httpwg.org/specs/rfc9110.html#status.308) -- [301 Moved Permanently](https://http.cat/status/301) -- [302 Found](https://http.cat/status/302) +### Examples -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/308](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/308) +http + + GET /featured HTTP/1.1 + Host: www.example.org + + +http + + HTTP/1.1 308 Permanent Redirect + Location: http://www.example.com/featured + Content-Length: 0 + + +### Specifications + +Specification + +[HTTP Semantics +\# status.308](https://httpwg.org/specs/rfc9110.html#status.308) + +### Browser compatibility + +### See also + +* [Redirections in HTTP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Redirections) +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`301 Moved Permanently`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/301), the equivalent of this status code that may modify the request method when it is not a [`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET) +* [`302 Found`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/302), a temporary redirect + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/308](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/308) diff --git a/content/400.md b/content/400.md index c8a31e11..51c35f65 100644 --- a/content/400.md +++ b/content/400.md @@ -1,11 +1,51 @@ ## Description -The HTTP `400 Bad Request` response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (for example, malformed request syntax, invalid request message framing, or deceptive request routing). +The HTTP **`400 Bad Request`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that the server would not process the request due to something the server considered to be a client error. The reason for a `400` response is typically due to malformed request syntax, invalid request message framing, or deceptive request routing. - +Clients that receive a `400` response should expect that repeating the request without modification will fail with the same error. -### See Also +### Examples -- [Spec](https://httpwg.org/specs/rfc9110.html#status.400) +Assuming a [REST](https://developer.mozilla.org/en-US/docs/Glossary/REST) API exists with an endpoint to manage users at `http://example.com/users` and a `POST` request with the following body attempts to create a user, but uses invalid JSON with unescaped line breaks: -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400) +http + + POST /users HTTP/1.1 + Host: example.com + Content-Type: application/json + Content-Length: 38 + + { + "email": "b@example.com + ", + "username": "b.smith" + } + + +If the [content](https://developer.mozilla.org/en-US/docs/Glossary/HTTP_Content) is in a valid format, we would expect a [`201 Created`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/201) response or another success message, but instead the server responds with a `400` and the response body includes a `message` field with some context so the client can retry the action with a properly-formed request: + +http + + HTTP/1.1 400 Bad Request + Content-Type: application/json + Content-Length: 71 + + { + "error": "Bad request", + "message": "Request body could not be read properly.", + } + + +### Specifications + +Specification + +[HTTP Semantics +\# status.400](https://httpwg.org/specs/rfc9110.html#status.400) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [HTTP Status Code Definitions](https://httpwg.org/specs/rfc9110.html#status.400) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/400](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/400) diff --git a/content/401.md b/content/401.md index 7f7fc598..668c7ce2 100644 --- a/content/401.md +++ b/content/401.md @@ -1,23 +1,44 @@ ## Description -The HTTP `401 Unauthorized` response status code indicates that the client request has not been -completed because it lacks valid authentication credentials for the requested resource. +The HTTP **`401 Unauthorized`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that a request was not successful because it lacks valid authentication credentials for the requested resource. This status code is sent with an HTTP [`WWW-Authenticate`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/WWW-Authenticate) response header that contains information on the [authentication scheme](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Authentication#authentication_schemes) the server expects the client to include to make the request successfully. -This status code is sent with an HTTP `WWW-Authenticate` response header that contains -information on how the client can request for the resource again after prompting the user for authentication credentials. +A `401 Unauthorized` is similar to the [`403 Forbidden`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/403) response, except that a 403 is returned when a request contains valid credentials, but the client does not have permissions to perform a certain action. -This status code is similar to the `403 Forbidden` status code, except that in situations resulting in this -status code, user authentication can allow access to the resource. +### Examples -### See Also +The following GET request is made to a URL `www.example.com/admin` that expects credentials in an [`Authorization`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Authorization) header: -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.401) -- [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication) -- [WWW-Authenticate](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/WWW-Authenticate) -- [Authorization](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization) -- [Proxy-Authenticate](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authenticate) -- [Proxy-Authorization](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authorization) -- [403 Forbidden](https://http.cat/status/403) -- [407 Proxy Authentication Required](https://http.cat/status/407) +http -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401) + GET /admin HTTP/1.1 + Host: example.com + + +The server responds with a 401 message and a [`WWW-Authenticate`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/WWW-Authenticate) header indicating that the request must be authenticated and that `Bearer` auth (an access token) is the permitted [authentication scheme](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Authentication#authentication_schemes): + +http + + HTTP/1.1 401 Unauthorized + Date: Tue, 02 Jul 2024 12:18:47 GMT + WWW-Authenticate: Bearer + + +### Specifications + +Specification + +[HTTP Semantics +\# status.401](https://www.rfc-editor.org/rfc/rfc9110#status.401) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Authentication) +* [Challenge](https://developer.mozilla.org/en-US/docs/Glossary/Challenge) +* [`WWW-Authenticate`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/WWW-Authenticate) +* [`Authorization`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Authorization) +* [`Proxy-Authorization`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Proxy-Authorization) +* [`Proxy-Authenticate`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Proxy-Authenticate) +* [`403`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/403), [`407`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/407) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/401](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/401) diff --git a/content/402.md b/content/402.md index 4ab73bdc..db8413e2 100644 --- a/content/402.md +++ b/content/402.md @@ -1,14 +1,74 @@ ## Description - +The HTTP **`402 Payment Required`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code is a **nonstandard** response status code reserved for future use. -The HTTP `402 Payment Required` is a nonstandard response status code that is reserved for future use. This status code was created to enable digital cash or (micro) payment systems and would indicate that the requested content is not available until the client makes a payment. +This status code was created to enable digital cash or (micro) payment systems and would indicate that requested content is not available until the client makes a payment. No standard use convention exists and different systems use it in different contexts. -Sometimes, this status code indicates that the request cannot be processed until the client makes a payment. However, no standard use convention exists and different entities use it in different contexts. +### Examples -### See Also +Some payment APIs use the 402 response as a generic catch-all for failed payment requests. The following example tries to make a call to a payment API using a POST request to initiate a transaction: -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.402) -- [HTTP Authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication) +http -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/402](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/402) + POST /merchant/transfers/payment HTTP/1.1 + Host: payments.example.com + Content-Type: application/json + Content-Length: 402 + + { + "payment_transfer": { + "reference": "PAYMENT123456", + "amount": "1337", + "currency": "EUR", + "sender_account_uri": "pan:5299920000000149;exp=2020-08;cvc=123", + "sender": { + "first_name": "Amelia", + "middle_name": "Rosenburg", + "email": "test123@sender.example.com" + }, + "recipient": { + "first_name": "Tyrone", + "middle_name": "Johnston", + "email": "test123@example.com", + "merchant_id": "123" + }, + "authentication_value": "ucaf:jJJLtQa+Iws8AREAEbjsA1MAAAA", + } + } + + +The server responds to the request with a 402 if there is a problem with the transaction, in this case, the card is expired: + +http + + HTTP/1.1 402 Payment Required + Date: Tue, 02 Jul 2024 12:56:49 GMT + Content-Type: application/json + Content-Length: 175 + + { + "error": { + "code": "expired_card", + "doc_url": "https://example.com/error-codes#expired-card", + "message": "The card has expired. Verify expiration or use a different card.", + } + } + + +### Specifications + +Specification + +[HTTP Semantics +\# status.402](https://httpwg.org/specs/rfc9110.html#status.402) + +### Compatibility notes + +This status code is _reserved_ but not defined. Actual implementations vary in the format and contents of the response. No browser supports a 402, and an error will be displayed as a generic `4xx` status code. + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Authentication) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/402](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/402) diff --git a/content/403.md b/content/403.md index d226ec5e..aefdca6d 100644 --- a/content/403.md +++ b/content/403.md @@ -1,12 +1,46 @@ ## Description -The HTTP `403 Forbidden` response status code indicates that the server understands the request but refuses to authorize it. +The HTTP **`403 Forbidden`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that the server understood the request but refused to process it. This status is similar to [`401`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/401), except that for **`403 Forbidden`** responses, authenticating or re-authenticating makes no difference. The request failure is tied to application logic, such as insufficient permissions to a resource or action. -This status is similar to `401`, but for the `403 Forbidden` status code, re-authenticating makes no difference. The access is tied to the application logic, such as insufficient rights to a resource. +Clients that receive a `403` response should expect that repeating the request without modification will fail with the same error. Server owners may decide to send a [`404`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/404) response instead of a 403 if acknowledging the existence of a resource to clients with insufficient privileges is not desired. -### See Also +### Examples -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.403) -- [401 Unauthorized](https://http.cat/status/401) +The following example request is made to an API for user management. The request contains an [`Authorization`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Authorization) header using `Bearer` [authentication scheme](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Authentication#authentication_schemes) containing an access token: -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403) +http + + DELETE /users/123 HTTP/1.1 + Host: example.com + Authorization: Bearer abcd123 + + +The server has authenticated the request, but the action fails due to insufficient rights and the response body contains a reason for the failure: + +http + + HTTP/1.1 403 Forbidden + Date: Tue, 02 Jul 2024 12:56:49 GMT + Content-Type: application/json + Content-Length: 88 + + { + "error": "InsufficientPermissions", + "message": "Deleting users requires the 'admin' role." + } + + +### Specifications + +Specification + +[HTTP Semantics +\# status.403](https://www.rfc-editor.org/rfc/rfc9110#status.403) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`401`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/401) +* [HTTP Status Code Definitions](https://httpwg.org/specs/rfc9110.html#status.403) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/403](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/403) diff --git a/content/404.md b/content/404.md index 4e0cde2e..3294c572 100644 --- a/content/404.md +++ b/content/404.md @@ -1,15 +1,65 @@ ## Description -The HTTP `404 Not Found` response status code indicates that the server cannot find the requested resource. -Links that lead to a `404` page are often called broken or dead links and can be subject to link rot. +The HTTP **`404 Not Found`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that the server cannot find the requested resource. Links that lead to a 404 page are often called broken or dead links and can be subject to [link rot](https://en.wikipedia.org/wiki/Link_rot). -A `404` status code only indicates that the resource is missing: not whether the absence is temporary or permanent. -If a resource is permanently removed, use the `410 Gone` status instead. +A 404 status code only indicates that the resource is missing without indicating if this is temporary or permanent. If a resource is permanently removed, servers should send the [`410 Gone`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/410) status instead. -### See Also +404 errors on a website can lead to a poor user experience for your visitors, so the number of broken links (internal and external) should be minimized to prevent frustration for readers. Common causes of 404 responses are mistyped URLs or pages that are moved or deleted without redirection. For more information, see the [Redirections in HTTP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Redirections) guide. -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.404) -- [410 Gone](https://http.cat/status/410) -- [Wikipedia: HTTP 404](https://en.wikipedia.org/wiki/HTTP_404) +### Examples -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404) +Fetching a non-existent page may look like the following request: + +http + + GET /my-deleted-blog-post HTTP/1.1 + Host: example.com + + +The server returns a response similar to this: + +http + + HTTP/1.1 404 Not Found + Age: 249970 + Cache-Control: max-age=604800 + Content-Type: text/html; charset=UTF-8 + Date: Fri, 28 Jun 2024 11:40:58 GMT + Expires: Fri, 05 Jul 2024 11:40:58 GMT + Last-Modified: Tue, 25 Jun 2024 14:14:48 GMT + Server: ECAcc (nyd/D13E) + Vary: Accept-Encoding + X-Cache: 404-HIT + Content-Length: 1256 + + + + 404 not found + ... + + +For the Apache server, you can specify a path to a custom 404 page in a `.htaccess` file. The example below uses `notfound.html` as a page to show visitors on 404s, although a common approach is to name the file `404.html` or `404.php` (depending on the server-side technology) at the top-level of the server: + +apacheconf + + ErrorDocument 404 /notfound.html + + +**Note:** Custom 404 page design is a good thing in moderation. Feel free to make your 404 page humorous and human, but don't confuse your visitors as to why they are seeing something unexpected. + +For an example of a custom 404 page, see the [KonMari 404 page](https://konmari.com/404). + +### Specifications + +Specification + +[HTTP Semantics +\# status.404](https://www.rfc-editor.org/rfc/rfc9110#status.404) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`410`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/410) +* [Wikipedia: HTTP 404](https://en.wikipedia.org/wiki/HTTP_404) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/404](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/404) diff --git a/content/405.md b/content/405.md index 464d1a66..df4d0a9f 100644 --- a/content/405.md +++ b/content/405.md @@ -1,11 +1,42 @@ ## Description -The HTTP `405 Method Not Allowed` response status code indicates that the server knows the request method, but the target resource doesn't support this method. +The HTTP **`405 Method Not Allowed`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that the server knows the request method, but the target resource doesn't support this method. The server **must** generate an [`Allow`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Allow) header in a 405 response with a list of methods that the target resource currently supports. -The server must generate an `Allow` header field in a `405` status code response. The field must contain a list of methods that the target resource currently supports. +Improper server-side permissions set on files or directories may cause a 405 response when the request would otherwise be expected to succeed. -### See Also +### Examples -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.405) -- [Allow](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Allow) -- [HTTP request methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) +Server owners often disallow the use of the `TRACE` method due to security concerns. The following example shows a typical response where a server doesn't allow the use of `TRACE`: + +http + + TRACE / HTTP/1.1 + Host: example.com + + +http + + HTTP/1.1 405 Method Not Allowed + Content-Length: 0 + Date: Fri, 28 Jun 2024 14:30:31 GMT + Server: ECLF (nyd/D179) + Allow: GET, POST, HEAD + + +### Specifications + +Specification + +[HTTP Semantics +\# status.405](https://httpwg.org/specs/rfc9110.html#status.405) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`Allow`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Allow) +* [`501 Not Implemented`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/501), [`510 Not Extended`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/510) +* [HTTP Status Code Definitions](https://httpwg.org/specs/rfc9110.html#status.405) +* [How to Fix 405 Method Not Allowed](https://kinsta.com/blog/405-method-not-allowed-error/) +* [Troubleshooting HTTP 405](https://learn.microsoft.com/en-us/aspnet/web-api/overview/testing-and-debugging/troubleshooting-http-405-errors-after-publishing-web-api-applications) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/405](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/405) diff --git a/content/406.md b/content/406.md index db1982a2..ad9bcc72 100644 --- a/content/406.md +++ b/content/406.md @@ -1,30 +1,56 @@ ## Description -The HTTP `406 Not Acceptable` client error response code indicates that the server cannot produce a response matching -the list of acceptable values defined in the request's proactive content negotiation headers, and -that the server is unwilling to supply a default representation. +The HTTP **`406 Not Acceptable`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that the server could not produce a response matching the list of acceptable values defined in the request's [proactive content negotiation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Content_negotiation#server-driven_content_negotiation) headers and that the server was unwilling to supply a default representation. Proactive content negotiation headers include: -- `Accept` -- `Accept-Encoding` -- `Accept-Language` +* [`Accept`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept) +* [`Accept-Encoding`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept-Encoding) +* [`Accept-Language`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept-Language) -In practice, this error is very rarely used. Instead of responding using this error -code, which would be cryptic for the end user and difficult to fix, servers ignore the -relevant header and serve an actual page to the user. It is assumed that even if the -user won't be completely happy, they will prefer this to an error code. +A server may return responses that differ from the request's accept headers. In such cases, a [`200`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/200) response with a default resource that doesn't match the client's list of acceptable content negotiation values may be preferable to sending a 406 response. -If a server returns such an error status, the body of the message should contain the -list of the available representations of the resources, allowing the user to choose -among them. +If a server returns a 406, the body of the message should contain the list of available representations for the resource, allowing the user to choose, although no standard way for this is defined. -### See Also +### Examples -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.406) -- [Accept](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept) -- [Accept-Encoding](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding) -- [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language) -- [Content negotiation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation) +The following request assumes that `www.example.com/docs/doc1` supports sending a document back as `application/rtf`: -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/406](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/406) +http + + GET /docs/doc1 HTTP/1.1 + Host: example.com + Accept: application/rtf; + + +In this example, the server implementation does not fallback to a default content type like `text/html` or `application/json`, but returns a 406 instead: + +http + + HTTP/1.1 406 Not Acceptable + Date: Wed, 26 Jun 2024 12:00:00 GMT + Server: Apache/2.4.1 (Unix) + Content-Type: application/json + + { + "code": "UnsupportedType", + "message": "Only 'text/html' or 'application/json' content types supported.", + } + + +### Specifications + +Specification + +[HTTP Semantics +\# status.406](https://www.rfc-editor.org/rfc/rfc9110#status.406) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`Accept`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept) +* [`Accept-Encoding`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept-Encoding) +* [`Accept-Language`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept-Language) +* HTTP [content negotiation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Content_negotiation) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/406](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/406) diff --git a/content/407.md b/content/407.md index 3e08b019..a342ff73 100644 --- a/content/407.md +++ b/content/407.md @@ -1,20 +1,43 @@ ## Description -The HTTP `407 Proxy Authentication Required` client error status response code indicates -that the request has not been applied because it lacks valid authentication credentials -for a proxy server that is between the browser and the server that can access the requested resource. +The HTTP **`407 Proxy Authentication Required`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that the request did not succeed because it lacks valid authentication credentials for the [proxy server](https://developer.mozilla.org/en-US/docs/Glossary/Proxy_server) that sits between the client and the server with access to the requested resource. -This status is sent with a `Proxy-Authenticate` header that contains information on how to authorize correctly. +This response is sent with a [`Proxy-Authenticate`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Proxy-Authenticate) header that contains information on how to correctly authenticate requests. The client may repeat the request with a new or replaced [`Proxy-Authorization`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Proxy-Authorization) header field. -### See Also +### Examples -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.407) -- [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication) -- [WWW-Authenticate](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/WWW-Authenticate) -- [Authorization](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization) -- [Proxy-Authenticate](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authenticate) -- [Proxy-Authorization](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authorization) -- [401 Unauthorized](https://http.cat/status/401) -- [403 Forbidden](https://http.cat/status/403) +A GET request is made to `example.com/admin`: -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/407](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/407) +http + + GET /admin HTTP/1.1 + Host: example.com + + +Along the way, an intermediary lets the client know that clients must be authenticated and provides information about the authentication scheme: + +http + + HTTP/1.1 407 Proxy Authentication Required + Date: Wed, 21 Oct 2015 07:28:00 GMT + Proxy-Authenticate: Basic realm="Access to internal site" + + +### Specifications + +Specification + +[HTTP Semantics +\# status.407](https://www.rfc-editor.org/rfc/rfc9110#status.407) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Authentication) +* [`WWW-Authenticate`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/WWW-Authenticate) +* [`Authorization`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Authorization) +* [`Proxy-Authorization`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Proxy-Authorization) +* [`Proxy-Authenticate`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Proxy-Authenticate) +* [`401`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/401), [`403`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/403) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/407](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/407) diff --git a/content/408.md b/content/408.md index 583f91a2..195a1996 100644 --- a/content/408.md +++ b/content/408.md @@ -1,23 +1,61 @@ ## Description -The HTTP `408 Request Timeout` response status code means that the -server would like to shut down this unused connection. It is sent on an idle connection -by some servers, even without any previous request by the client. +The HTTP **`408 Request Timeout`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that the server would like to shut down this unused connection. A `408` is sent on an idle connection by some servers, _even without any previous request by the client_. -A server should send the "close" `Connection` header field in the -response, since `408` implies that the server has decided to close the -connection rather than continue waiting. +A server should send the [`Connection: close`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Connection) header field in the response, since `408` implies that the server has decided to close the connection rather than continue waiting. -This response is used much more since some browsers, like Chrome, Firefox 27+, and IE9, -use HTTP pre-connection mechanisms to speed up surfing. +This response is used much more since some browsers, like Chrome and Firefox, use HTTP pre-connection mechanisms to speed up surfing. - +**Note:** Some servers will shut down a connection without sending this message. -### See Also +### Examples -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.408) -- [Connection](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Connection) -- [X-DNS-Prefetch-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-DNS-Prefetch-Control) +The following example shows what a client may send when an [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/file) element uses an image on form submission with `method="post"`: -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) +http + + POST /upload HTTP/1.1 + Host: example.com + Content-Type: multipart/form-data; boundary=----Boundary1234 + Content-Length: 4012345 + + ------Boundary1234 + Content-Disposition: form-data; name="file"; filename="myImage.jpg" + Content-Type: image/jpeg + + \xFF\xD8\xFF\xE0\x00...(binary data) + ------Boundary1234-- + + +If the data is not received in full due to network issues or latency, the server may timeout the connection. Clients may repeat the request again, and a new connection will be used: + +http + + HTTP/1.1 408 Request Timeout + Content-Type: text/html + + + + 408 Request Timeout + + +

408 Request Timeout

+

Failed to process request in time. Please try again.

+ + + + +### Specifications + +Specification + +[HTTP Semantics +\# status.408](https://httpwg.org/specs/rfc9110.html#status.408) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`Connection`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Connection) +* [`X-DNS-Prefetch-Control`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-DNS-Prefetch-Control) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/408) diff --git a/content/409.md b/content/409.md index e863ede5..edd83c41 100644 --- a/content/409.md +++ b/content/409.md @@ -1,12 +1,54 @@ ## Description -The HTTP `409 Conflict` response status code indicates a request conflict with the current state of the target resource. +The HTTP **`409 Conflict`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates a request conflict with the current state of the target resource. -Conflicts are most likely to occur in response to a `PUT` request. For example, you may get a `409` response when uploading a file that is older than the existing one on the server, resulting in a version control conflict. +In [WebDAV](https://developer.mozilla.org/en-US/docs/Glossary/WebDAV) remote web authoring, 409 conflict responses are errors sent to the client so that a user might be able to resolve a conflict and resubmit the request. For example, conflicts occur if a request to create collection `/a/b/c/d/` is made, and `/a/b/c/` does not exist, the request must fail with a 409. Additionally, you may get a 409 response when uploading a file that is older than the existing one on the server, resulting in a version control conflict. -### See Also +In other systems, 409 responses may be used for implementation-specific purposes, such as to indicate that the server has received multiple requests to update the same resource. -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.409) -- [PUT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT) +### Examples -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) +In the following example, we want to kick off an automation process that performs a common task in the system: + +http + + POST /tasks HTTP/1.1 + Host: example.com + Content-Type: application/json + + { + "task": "emailDogOwners", + "template": "pickup" + } + + +In this implementation, the server disallows two concurrent jobs from running and returns a 409, providing the client an opportunity to check if they meant to perform the action or run a different task: + +http + + HTTP/1.1 409 Conflict + Date: Wed, 26 Jun 2024 12:00:00 GMT + Server: Apache/2.4.1 (Unix) + Content-Type: application/json + + { + "code": "AutomationConflict", + "task": "emailDogOwners", + "message": "Task locked. Cannot start a new automation since job is already running.", + "runningTaskId": "123" + } + + +### Specifications + +Specification + +[HTTP Semantics +\# status.409](https://www.rfc-editor.org/rfc/rfc9110#status.409) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`PUT`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/PUT) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/409) diff --git a/content/410.md b/content/410.md index b6328d8f..b7ffc6f7 100644 --- a/content/410.md +++ b/content/410.md @@ -1,14 +1,47 @@ ## Description -The HTTP `410 Gone` client error response code indicates that access to the target resource is no longer available at the origin server and that this condition is likely to be permanent. +The HTTP **`410 Gone`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that the target resource is no longer available at the origin server and that this condition is likely to be permanent. A 410 response is cacheable by default. -If you don't know whether this condition is temporary or permanent, a `404` status code should be used instead. +Clients should not repeat requests for resources that return a 410 response, and website owners should remove or replace links that return this code. If server owners don't know whether this condition is temporary or permanent, a [`404`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/404) status code should be used instead. - +### Examples -### See Also +The following `GET` request is for a page with promotional content that is no longer valid: -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.410) -- [404 Not Found](https://http.cat/status/404) +http -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/410](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/410) + GET /promotions/summer-2023 HTTP/1.1 + Host: example.com + + +http + + HTTP/1.1 410 Gone + Content-Type: text/html + Content-Length: 212 + + + + Promotion expired + + +

Promotion expired

+

Promotion no longer active! See current offers.

+ + + + +### Specifications + +Specification + +[HTTP Semantics +\# status.410](https://www.rfc-editor.org/rfc/rfc9110#status.410) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`404`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/404) +* [410 gone](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#410) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/410](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/410) diff --git a/content/411.md b/content/411.md index 3ff4f2d8..1abd2cad 100644 --- a/content/411.md +++ b/content/411.md @@ -1,18 +1,50 @@ ## Description -The HTTP `411 Length Required` client error response code indicates -that the server refuses to accept the request without a defined `Content-Length` header. +The HTTP **`411 Length Required`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that the server refused to accept the request without a defined [`Content-Length`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Length) header. - +**Note:** When sending data in a series of chunks, the `Content-Length` header is omitted, and at the beginning of each chunk, the length of the current chunk needs to be included in hexadecimal format. See [`Transfer-Encoding`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Transfer-Encoding) for more details. -### See Also +### Examples -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.411) -- [Content-Length](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Length) -- [Transfer-Encoding](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding) +The following request is sent chunked, which is the default method of sending data in some cases, such as when [writing to streams](https://nodejs.org/api/http.html#requestwritechunk-encoding-callback): -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/411](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/411) +http + POST /translate/de HTTP/1.1 + Host: api.example.com + Content-Type: application/json + Transfer-encoding: chunked + + 2C + {"text": "Hurry up, Ayşe is hungry!"} + 0 + + +In this case, the server is expecting a request in one part with a [`Content-Length`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Length) header and returns a 411 response: + +http + + HTTP/1.1 411 Length Required + Content-Type: application/json + Content-Length: 110 + + { + "message": "Requests must have a content length header.", + "documentation": "http://api/example.com/docs/errors", + } + + +### Specifications + +Specification + +[HTTP Semantics +\# status.411](https://httpwg.org/specs/rfc9110.html#status.411) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`Content-Length`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Length) +* [`Transfer-Encoding`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Transfer-Encoding) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/411](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/411) diff --git a/content/412.md b/content/412.md index d10fd65b..1af605b1 100644 --- a/content/412.md +++ b/content/412.md @@ -1,19 +1,44 @@ ## Description -The HTTP `412 Precondition Failed` client error response code -indicates that access to the target resource has been denied. This happens with -conditional requests on methods other than `GET` or -`HEAD` when the condition defined by the -`If-Unmodified-Since` or `If-None-Match` headers is not -fulfilled. In that case, the request, usually an upload or a modification of a resource, -cannot be made and this error response is sent back. - -### See Also - -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.412) -- [If-Unmodified-Since](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Unmodified-Since) -- [If-None-Match](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match) -- [304 Not Modified](https://http.cat/status/304) -- [428 Precondition Required](https://http.cat/status/428) - -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/412](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/412) +The HTTP **`412 Precondition Failed`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that access to the target resource was denied. This happens with [conditional requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Conditional_requests) on methods other than [`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET) or [`HEAD`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/HEAD) when the condition defined by the [`If-Unmodified-Since`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-Unmodified-Since) or [`If-Match`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-Match) headers is not fulfilled. In that case, the request (usually an upload or a modification of a resource) cannot be made and this error response is sent back. + +### Examples + +http + + ETag: "33a64df551425fcc55e4d42a148795d9f25f89d4" + ETag: W/"0815" + + +With the help of the `ETag` and the [`If-Match`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-Match) headers, you can prevent conflicts or mid-air collisions. For example, when editing some wiki pages, content is hashed and put into an `ETag` in successful responses: + +http + + ETag: "33a64df551425fcc55e4d42a148795d9f25f89d4" + + +When saving changes to a wiki page (posting data), the [`POST`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/POST) request will contain the [`If-Match`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-Match) header containing the `ETag` values that the client stored from the last edit to check freshness of the resource on the server: + +http + + If-Match: "33a64df551425fcc55e4d42a148795d9f25f89d4" + + +If the hashes don't match, the document has been edited in-between and a `412 Precondition Failed` error is thrown. + +### Specifications + +Specification + +[HTTP Semantics +\# status.412](https://www.rfc-editor.org/rfc/rfc9110#status.412) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [Conditional requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Conditional_requests) +* [`304`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/304) +* [`If-Unmodified-Since`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-Unmodified-Since), [`If-Match`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-Match) +* [`428`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/428) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/412](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/412) diff --git a/content/413.md b/content/413.md index 2da6ac04..c4aeaf31 100644 --- a/content/413.md +++ b/content/413.md @@ -1,13 +1,53 @@ ## Description -The HTTP `413 Content Too Large` response status code indicates that the request entity is larger than limits defined by server; the server might close the connection or return a `Retry-After` header field. +The HTTP **`413 Content Too Large`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that the request entity was larger than limits defined by server. The server might close the connection or return a [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Retry-After) header field. -Prior to RFC 9110 the response phrase for the status was Payload Too Large. That name is still widely used. +Prior to [RFC 9110](https://datatracker.ietf.org/doc/html/rfc9110) the response phrase for the status was **`Payload Too Large`**. This message is still widely used. -### See Also +### Examples -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.413) -- [Connection](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Connection) -- [Retry-After](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) +The following example shows what the client may send when an [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/file) element includes an image on form submission with `method="post"`: -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/413](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/413) +http + + POST /upload HTTP/1.1 + Host: example.com + Content-Type: multipart/form-data; boundary=----Boundary1234 + Content-Length: 4012345 + + ------Boundary1234 + Content-Disposition: form-data; name="file"; filename="myImage.jpg" + Content-Type: image/jpeg + + \xFF\xD8\xFF\xE0\x00...(binary data) + ------Boundary1234-- + + +The server may reject the upload if there is a restriction on the maximum size of files it will process, and the response body includes a `message` with some context: + +http + + HTTP/1.1 413 Content Too Large + Content-Type: application/json + Content-Length: 97 + + { + "error": "Upload failed", + "message": "Maximum allowed upload size is 4MB", + } + + +### Specifications + +Specification + +[HTTP Semantics +\# status.413](https://httpwg.org/specs/rfc9110.html#status.413) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`Connection`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Connection) +* [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Retry-After) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/413](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/413) diff --git a/content/414.md b/content/414.md index dd8a9f9c..ef76846c 100644 --- a/content/414.md +++ b/content/414.md @@ -1,19 +1,55 @@ ## Description -The HTTP `414 URI Too Long` response status code indicates -that the URI requested by the client is longer than the server is willing to interpret. +The HTTP **`414 URI Too Long`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that a URI requested by the client was longer than the server is willing to interpret. -There are a few rare conditions when this might occur: +There are a few rare conditions when this error might occur: -- when a client has improperly converted a `POST` request to a `GET` request with long query information, -- when the client has descended into a loop of redirection (for example, a redirected -URI prefix that points to a suffix of itself), -- or when the server is under attack by a client attempting to exploit potential -security holes. +* a client has improperly converted a [`POST`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/POST) request to a [`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET) request with long query information, +* a client has descended into a loop of redirection (for example, a redirected URI prefix that points to a suffix of itself), or +* the server is under attack by a client attempting to exploit potential security holes. -### See Also +Some systems implement `414 URI Too Long` as `414 Request-URI Too Large`. -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.414) -- [URI](https://developer.mozilla.org/en-US/docs/Glossary/URI) +### Examples -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/414](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/414) +In the following example, an HTML [`
` method](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/form#method) accidentally uses `get` instead of `post`. A large amount of form data is appended to the URL specified at the form's `action` attribute and is sent as a GET request: + +http + + GET /search?feedback=it+was+the+best+of+times+it+was+the+worst+of+times… HTTP/1.1 + Host: example.com + + +The particular server's URI length limit is reached with this request and a 414 is sent in response: + +http + + HTTP/1.1 414 URI Too Long + Content-Type: text/html; charset=UTF-8 + Date: Fri, 28 Jun 2024 11:40:58 GMT + Content-Length: 1234 + + + + 414 - URI Too Long + + +

414 - URI Too Long

+

The URI provided was too long for the server to process.

+ + + + +### Specifications + +Specification + +[HTTP Semantics +\# status.414](https://httpwg.org/specs/rfc9110.html#status.414) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [URI](https://developer.mozilla.org/en-US/docs/Glossary/URI) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/414](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/414) diff --git a/content/415.md b/content/415.md index e412a0b9..20bdba14 100644 --- a/content/415.md +++ b/content/415.md @@ -1,17 +1,74 @@ ## Description -The HTTP `415 Unsupported Media Type` client error response -code indicates that the server refuses to accept the request because the payload format -is in an unsupported format. +The HTTP **`415 Unsupported Media Type`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that the server refused to accept the request because the message [content](https://developer.mozilla.org/en-US/docs/Glossary/HTTP_Content) format is not supported. -The format problem might be due to the request's indicated -`Content-Type` or `Content-Encoding`, or as a result of inspecting the data directly. +The format problem might be due to the request's indicated [`Content-Type`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Type) or [`Content-Encoding`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Encoding), or as a result of processing the request message content. Some servers may be strict about the expected `Content-Type` of requests. For example, sending `UTF8` instead of `UTF-8` to specify the [UTF-8](https://developer.mozilla.org/en-US/docs/Glossary/UTF-8) charset may cause the server to consider the media type invalid. -### See Also +### Examples -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.415) -- [Content-Type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type) -- [Content-Encoding](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding) -- [Accept](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept) +In the following example, the [`Content-Type`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Type) header is missing entirely: -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/415](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/415) +http + + POST /comments HTTP/1.1 + Host: example.com + Content-Length: 23 + + { + "user": "belgin", + "comment": "LGTM!" + } + + +If the server implementation expects at least a MIME type `Content-Type: application/json;` for the request at that endpoint, it may send the following response: + +http + + HTTP/1.1 415 Unsupported Media Type + Date: Fri, 28 Jun 2024 12:00:00 GMT + Server: Apache/2.4.41 (Ubuntu) + Accept-Post: application/json; charset=UTF-8 + Content-Length: 0 + + +In the following example, the [`Content-Type`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Type) header is incorrectly set to URL-encoded form data when the [content](https://developer.mozilla.org/en-US/docs/Glossary/HTTP_Content) is in the request body instead: + +http + + POST /comments HTTP/1.1 + Host: example.com + Content-Length: 23 + Content-Type: application/x-www-form-urlencoded + + { + "user": "belgin", + "comment": "LGTM!" + } + + +In this case, the server responds with a 415, with the required content type for the request in the [`Accept-Post`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept-Post) header: + +http + + HTTP/1.1 415 Unsupported Media Type + Date: Fri, 28 Jun 2024 12:00:00 GMT + Server: Apache/2.4.41 (Ubuntu) + Accept-Post: application/json; charset=UTF-8 + Content-Length: 0 + + +### Specifications + +Specification + +[HTTP Semantics +\# status.415](https://httpwg.org/specs/rfc9110.html#status.415) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`Content-Type`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Type) +* [`Content-Encoding`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Encoding) +* [`Accept-Post`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept-Post) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/415](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/415) diff --git a/content/416.md b/content/416.md index 1572ae8d..381e030e 100644 --- a/content/416.md +++ b/content/416.md @@ -1,16 +1,44 @@ ## Description -The HTTP `416 Range Not Satisfiable` error response code indicates that a server cannot serve the requested ranges. The most likely reason is that the document doesn't contain such ranges, or that the Range header value, though syntactically correct, doesn't make sense. +The HTTP **`416 Range Not Satisfiable`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that a server could not serve the requested ranges. The most likely reason for this response is that the document doesn't contain such [ranges](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Range_requests), or that the [`Range`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Range) header value, though syntactically correct, doesn't make sense. -The `416` response message contains a `Content-Range` indicating an unsatisfied range (that is a `'*'`) followed by a `'/'` and the current length of the resource. E.g. `Content-Range: bytes */12777`. +The `416` response message should contain a [`Content-Range`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Range) indicating an unsatisfied range (that is a `'*'`) followed by a `'/'` and the current length of the resource, e.g., `Content-Range: bytes */12777` -Faced with this error, browsers usually either abort the operation (for example, a download will be considered as non-resumable) or ask for the whole document again. +When encountering this error, browsers typically either abort the operation (for example, a download will be considered non-resumable) or request the whole document again without ranges. -### See Also +### Examples -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.416) -- [Range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range) -- [Content-Range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) -- [206 Partial Content](https://http.cat/status/206) +The following request asks for a range of 1000-1999 bytes from a text file. The first position unit (1000) is larger than the actual resource on the server (800 bytes): -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/416](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/416) +http + + GET /files/prose.txt HTTP/1.1 + Host: example.com + Range: bytes=1000-1999 + + +The server supports range requests and sends back the current length of the selected representation in the [`Content-Range`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Range) header: + +http + + HTTP/1.1 416 Range Not Satisfiable + Date: Fri, 28 Jun 2024 11:40:58 GMT + Content-Range: bytes */800 + + +### Specifications + +Specification + +[HTTP Semantics +\# status.416](https://www.rfc-editor.org/rfc/rfc9110#status.416) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`206 Partial Content`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/206) +* [HTTP range requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Range_requests) +* [`Content-Range`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Range) +* [`Range`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Range) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/416](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/416) diff --git a/content/417.md b/content/417.md index d89a52aa..87a8de34 100644 --- a/content/417.md +++ b/content/417.md @@ -1,11 +1,51 @@ ## Description -The HTTP `417 Expectation Failed` client error response code indicates that the -expectation given in the request's `Expect` header could not be met. +The HTTP **`417 Expectation Failed`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that the expectation given in the request's [`Expect`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Expect) header could not be met. After receiving a 417 response, a client should repeat the request without an `Expect` request header, including the file in the request body without waiting for a [`100`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/100) response. See the [`Expect`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Expect) header documentation for more details. -### See Also +### Examples -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.417) -- [Expect](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expect) +The following PUT request sends information about an intended file upload to a server. The client uses an `Expect: 100-continue` header and no request body to avoid sending data over the network that may result in an error such as [`405`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/405), [`401`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/401), or [`403`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/403) response: -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/417](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/417) +http + + PUT /videos HTTP/1.1 + Host: uploads.example.com + Content-Type: video/h264 + Content-Length: 1234567890987 + Expect: 100-continue + + +In this example server implementation, expectations are not supported and the presence of an `Expect` header with any value results in 417 responses: + +http + + HTTP/1.1 417 Expectation Failed + Date: Fri, 28 Jun 2024 11:40:58 GMT + + +The client responds by making a request without expectations and with the [content](https://developer.mozilla.org/en-US/docs/Glossary/HTTP_Content) in the request body: + +http + + PUT /videos HTTP/1.1 + Host: uploads.example.com + Content-Type: video/h264 + Content-Length: 1234567890987 + + […] + + +### Specifications + +Specification + +[HTTP Semantics +\# status.417](https://httpwg.org/specs/rfc9110.html#status.417) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`100 Continue`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/100) +* [`Expect`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Expect) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/417](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/417) diff --git a/content/418.md b/content/418.md index 689cc4f6..ed2ed877 100644 --- a/content/418.md +++ b/content/418.md @@ -1,14 +1,24 @@ ## Description -The HTTP `418 I'm a teapot` client error response code indicates that the server refuses to brew coffee because it is, permanently, a teapot. +The HTTP **`418 I'm a teapot`** status response code indicates that the server refuses to brew coffee because it is, permanently, a teapot. A combined coffee/tea pot that is temporarily out of coffee should instead return [`503`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/503). This error is a reference to Hyper Text Coffee Pot Control Protocol defined in April Fools' jokes in 1998 and 2014. -A combined coffee/tea pot that is temporarily out of coffee should instead return 503. This error is a reference to Hyper Text Coffee Pot Control Protocol defined in April Fools' jokes in 1998 and 2014. +While originally defined in [RFC 2324](https://www.rfc-editor.org/rfc/rfc2324) as an April Fools' joke, this status code was formally reserved in [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110) due to its wide deployment as a joke, so it cannot be assigned any non-joke semantics for the foreseeable future. Some websites use this response for requests they do not wish to handle, such as automated queries. -### See Also +### Specifications -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.418) -- [Wikipedia: Hyper Text Coffee Pot Control Protocol](https://en.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Control_Protocol) +Specification -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/418](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/418) +[RFC 2324 +\# section-2.3.2](https://www.rfc-editor.org/rfc/rfc2324#section-2.3.2) + +[HTTP Semantics +\# name-418-unused](https://www.rfc-editor.org/rfc/rfc9110#name-418-unused) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [Wikipedia: Hyper Text Coffee Pot Control Protocol](https://en.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Control_Protocol) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/418](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/418) diff --git a/content/421.md b/content/421.md index 7e9230df..78fa10fa 100644 --- a/content/421.md +++ b/content/421.md @@ -1,9 +1,41 @@ ## Description -The HTTP `421 Misdirected Request` client error response code indicates that the request was directed to a server that is not able to produce a response. This might be possible if a connection is reused or if an alternative service is selected. +The HTTP **`421 Misdirected Request`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that the request was directed to a server that is not able to produce a response. This can be sent by a server that is not configured to produce responses for the combination of [scheme](https://developer.mozilla.org/en-US/docs/Web/URI/Reference/Schemes) and [authority](https://developer.mozilla.org/en-US/docs/Web/URI/Reference/Authority) that are included in the request URI. -### See Also +Clients may retry the request over a different connection. -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.421) +### Examples -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/421](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/421) +Given the following request: + +http + + GET / HTTP/1.1 + Host: abc.example.com + + +In cases such as a wildcard certificate (`*.example.com`) where a connection is reused for multiple domains (`abc.example.com`, `def.example.com`), the server may respond with a 421: + +http + + HTTP/1.1 421 Misdirected Request + Date: Wed, 26 Jun 2024 12:00:00 GMT + Server: Apache/2.4.1 (Unix) + + +### Specifications + +Specification + +[HTTP Semantics +\# name-421-misdirected-request](https://www.rfc-editor.org/rfc/rfc9110#name-421-misdirected-request) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [Multiple hosts and misdirected requests](https://httpd.apache.org/docs/2.4/mod/mod_http2.html#misdirected) Apache Server documentation +* [TLS 1.3](https://developer.mozilla.org/en-US/docs/Web/Security/Defenses/Transport_Layer_Security#tls_1.3) +* [Server Name Indication (SNI)](https://en.wikipedia.org/wiki/Server_Name_Indication) +* [Transport Layer Security (TLS) configuration](https://developer.mozilla.org/en-US/docs/Web/Security/Practical_implementation_guides/TLS) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/421](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/421) diff --git a/content/422.md b/content/422.md index 8e8c6cb6..d0407cfe 100644 --- a/content/422.md +++ b/content/422.md @@ -1,13 +1,53 @@ ## Description -The HTTP `422 Unprocessable Content` response status code indicates -that the server understands the content type of the request entity, and the syntax of -the request entity is correct, but it was unable to process the contained instructions. +The HTTP **`422 Unprocessable Content`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that the server understood the content type of the request content, and the syntax of the request content was correct, but it was unable to process the contained instructions. - +Clients that receive a `422` response should expect that repeating the request without modification will fail with the same error. -### See Also +### Examples -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.422) +The following example makes a request to update file contents ([based on GitHub's API](https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28#create-or-update-file-contents)). The `content` field is [Base64](https://developer.mozilla.org/en-US/docs/Glossary/Base64) encoded and uses `\n` line feeds every 60 characters, with one terminating the string: -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422) +http + + PUT /repos/mdn/content/contents/README.md HTTP/1.1 + Host: api.example.com + Accept: application/vnd.github+json + Authorization: Bearer abcd123 + Content-Type: application/json + Content-Length: 165 + + { + "message": "My commit", + "content": "WW9zaGkgd2FzIHRoZXJlLCBzbyB3ZXJlIEF5c2UsIGFuZCBCZWxnaW4uIEl0\nIHdhcyBncmVhdCE=\n", + "sha": "80e73970fdee49dbdbac27c1f565d1eb1975d519" + } + + +In this implementation, the server expects strictly [RFC 4648](https://datatracker.ietf.org/doc/html/rfc4648)\-compliant Base64 encoded content (using [strict encoding methods](https://ruby-doc.org/3.3.2/stdlibs/base64/Base64.html#method-i-strict_encode64)). A `422` Unprocessable Content response is returned and the `message` field provides context about the validation error: + +http + + HTTP/1.1 422 Unprocessable Content + Date: Fri, 28 Jun 2024 12:00:00 GMT + Content-Type: application/json; charset=utf-8 + Content-Length: 187 + + { + "message": "content is not valid Base64", + "documentation_url": "https://docs.example.com/en/rest/repos/contents" + } + + +### Specifications + +Specification + +[HTTP Semantics +\# status.422](https://httpwg.org/specs/rfc9110.html#status.422) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/422](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/422) diff --git a/content/423.md b/content/423.md index 2f1cba7a..f3b9ee0b 100644 --- a/content/423.md +++ b/content/423.md @@ -1,12 +1,34 @@ ## Description -The HTTP `423 Locked` error response code indicates that either the resources tentatively targeted by is locked, meaning it can't be accessed. Its content should contain some information in WebDAV's XML format. +The HTTP **`423 Locked`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that a resource is _locked_, meaning it can't be accessed. Its response body should contain information in [WebDAV](https://developer.mozilla.org/en-US/docs/Glossary/WebDAV)'s XML format. - +**Note:** The ability to _lock_ a resource to prevent conflicts is specific to some [WebDAV](https://developer.mozilla.org/en-US/docs/Glossary/WebDAV) servers. Browsers accessing web pages will never encounter this status code; in the erroneous cases it happens, they will handle it as a generic [`400`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/400) status code. -### See Also +### Examples -- [Spec](https://www.rfc-editor.org/rfc/rfc4918#section-11.3) -- [WebDAV](https://developer.mozilla.org/en-US/docs/Glossary/WebDAV) +http -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/423](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/423) + HTTP/1.1 423 Locked + Content-Type: application/xml; charset="utf-8" + Content-Length: xxxx + + + + + /workspace/web-dav/ + + + + +### Specifications + +Specification + +[RFC 4918 +\# section-11.3](https://www.rfc-editor.org/rfc/rfc4918#section-11.3) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/423](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/423) diff --git a/content/424.md b/content/424.md index 425edb2d..dd91a6eb 100644 --- a/content/424.md +++ b/content/424.md @@ -1,13 +1,20 @@ ## Description -The HTTP `424 Failed Dependency` client error response code indicates that the method could not be performed on the resource because the requested action depended on another action, and that action failed. +The HTTP **`424 Failed Dependency`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that the method could not be performed on the resource because the requested action depended on another action, and that action failed. -Regular web servers will normally not return this status code. But some other protocols, like WebDAV, can return it. For example, in WebDAV, if a `PROPPATCH` request was issued, and one command fails then automatically every other command will also fail with `424 Failed Dependency`. +Regular web servers typically do not return this status code, but some protocols like [WebDAV](https://developer.mozilla.org/en-US/docs/Glossary/WebDAV) can return it. For example, in [WebDAV](https://developer.mozilla.org/en-US/docs/Glossary/WebDAV), if a `PROPPATCH` request was issued, and one command fails then automatically every other command will also fail with `424 Failed Dependency`. -### See Also +### Specifications -- [Spec](https://www.rfc-editor.org/rfc/rfc4918#section-11.4) -- [403 Forbidden](https://http.cat/status/403) -- [WebDAV](https://developer.mozilla.org/en-US/docs/Glossary/WebDAV) +Specification -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/424](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/424) +[RFC 4918 +\# section-11.4](https://www.rfc-editor.org/rfc/rfc4918#section-11.4) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`403`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/403) (Forbidden) +* [`501 Not Implemented`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/501), [`510 Not Extended`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/510) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/424](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/424) diff --git a/content/425.md b/content/425.md index cd3b2ddf..c3fefd76 100644 --- a/content/425.md +++ b/content/425.md @@ -1,11 +1,32 @@ ## Description -The HTTP `425 Too Early` response status code indicates that the server is unwilling to risk processing a request -that might be replayed, which creates the potential for a replay attack. +Limited availability -### See Also +This feature is not Baseline because it does not work in some of the most widely-used browsers. -- [Spec](https://httpwg.org/specs/rfc8470.html#status) -- [Replay attack](https://en.wikipedia.org/wiki/Replay_attack) +* [Learn more](https://developer.mozilla.org/en-US/docs/Glossary/Baseline/Compatibility) +* [See full compatibility](#browser_compatibility) +* [Report feedback](https://survey.alchemer.com/s3/7634825/MDN-baseline-feedback?page=%2Fen-US%2Fdocs%2FWeb%2FHTTP%2FReference%2FStatus%2F425&level=not) -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/425](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/425) +if (localStorage.getItem("baseline-indicator") === "open") { const indicator = document.querySelector(".baseline-indicator"); if (indicator instanceof HTMLDetailsElement) { indicator.open = true; } } + +The HTTP **`425 Too Early`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that the server was unwilling to risk processing a request that might be replayed to avoid potential replay attacks. + +If a client has interacted with a server recently, early data (also known as zero round-trip time [(0-RTT) data](https://developer.mozilla.org/en-US/docs/Web/Security/Defenses/Transport_Layer_Security#tls_1.3)) allows the client to send data to a server in the first round trip of a connection, without waiting for the TLS [handshake](https://developer.mozilla.org/en-US/docs/Glossary/TCP_handshake) to complete. A client that sends a request in early data does not need to include the `Early-Data` header. See [`Early-Data`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Early-Data) for more information. + +### Specifications + +Specification + +[Using Early Data in HTTP +\# status](https://httpwg.org/specs/rfc8470.html#status) + +### Browser compatibility + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [TLS 1.3](https://developer.mozilla.org/en-US/docs/Web/Security/Defenses/Transport_Layer_Security#tls_1.3) +* [`Early-Data`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Early-Data) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/425](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/425) diff --git a/content/426.md b/content/426.md index f8a52850..acc0aa86 100644 --- a/content/426.md +++ b/content/426.md @@ -1,15 +1,43 @@ ## Description -The HTTP `426 Upgrade Required` client error response code -indicates that the server refuses to perform the request using the current protocol but -might be willing to do so after the client upgrades to a different protocol. +The HTTP **`426 Upgrade Required`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that the server refused to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol. -The server sends an `Upgrade` header with this response to indicate the required protocol(s). +The server sends an [`Upgrade`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Upgrade) header with this response to indicate the required protocol(s). -### See Also +### Examples -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.426) -- [Upgrade](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Upgrade) -- [101 Switching Protocols](https://http.cat/status/101) +Given a GET request to a system: -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/426](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/426) +http + + GET /resources HTTP/1.1 + Host: example.com + + +The origin server expects that requests must be made in [HTTP/3](https://developer.mozilla.org/en-US/docs/Glossary/HTTP_3): + +http + + HTTP/1.1 426 Upgrade Required + Upgrade: HTTP/3.0 + Connection: Upgrade + Content-Length: 53 + Content-Type: text/plain + + This service requires use of the HTTP/3.0 protocol. + + +### Specifications + +Specification + +[HTTP Semantics +\# status.426](https://httpwg.org/specs/rfc9110.html#status.426) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`Upgrade`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Upgrade) +* [`101 Switching Protocols`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/101) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/426](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/426) diff --git a/content/428.md b/content/428.md index 163beaee..0cc9ee8c 100644 --- a/content/428.md +++ b/content/428.md @@ -1,16 +1,50 @@ ## Description -The HTTP `428 Precondition Required` response status code indicates that the server requires the request to be conditional. +The HTTP **`428 Precondition Required`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that the server requires the request to be [conditional](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Conditional_requests). -Typically, this means that a required precondition header, such as `If-Match`, is missing. +Typically, a 428 response means that a required precondition header such as [`If-Match`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-Match) **is missing**. When a precondition header does **not match** the server-side state, the response should be [`412 Precondition Failed`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/412). -When a precondition header is not matching the server side state, the response should be `412 Precondition Failed`. +### Examples -### See Also +A client has fetched a resource `my-document` from the server, updated it locally, and then tries to send the updated document back to the server: -- [Spec](https://tools.ietf.org/html/rfc6585#section-3) -- [HTTP Conditional Requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Conditional_requests) -- [If-Match](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match) -- [412 Precondition Failed](https://http.cat/status/412) +http -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/428](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/428) + PUT /docs/my-document HTTP/1.1 + Host: example.com + Content-Type: application/json + + { + […] + + +The server implementation requires that all [`PUT`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/PUT) requests for the specific path or type of documents must be conditional and sends a 428 response: + +http + + HTTP/1.1 428 Precondition Required + Date: Wed, 26 Jun 2024 12:00:00 GMT + Server: Apache/2.4.1 (Unix) + Content-Type: application/json + + { + "code": "MissingPrecondition", + "message": "Updating documents requires a precondition header.", + } + + +### Specifications + +Specification + +[RFC 6585 +\# section-3](https://www.rfc-editor.org/rfc/rfc6585#section-3) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [HTTP conditional requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Conditional_requests) +* Conditional headers: [`If-Match`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-Match), [`If-None-Match`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-None-Match), [`If-Modified-Since`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-Modified-Since), [`If-Unmodified-Since`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-Unmodified-Since), [`If-Range`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-Range) +* [`412`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/412) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/428](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/428) diff --git a/content/429.md b/content/429.md index 32ae2ec3..24c82628 100644 --- a/content/429.md +++ b/content/429.md @@ -1,12 +1,51 @@ ## Description -The HTTP `429 Too Many Requests` response status code indicates the user has sent too many requests in a given amount of time ("rate limiting"). +The HTTP **`429 Too Many Requests`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates the client has sent too many requests in a given amount of time. This mechanism of asking the client to slow down the rate of requests is commonly called "[rate limiting](https://developer.mozilla.org/en-US/docs/Glossary/Rate_limit)". -A `Retry-After` header might be included to this response indicating how long to wait before making a new request. +A [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Retry-After) header may be included to this response to indicate how long a client should wait before making the request again. -### See Also +Implementations of rate limiting vary; restrictions may be server-wide or per resource. Typically, rate-limiting restrictions are based on a client's IP but can be specific to users or authorized applications if requests are authenticated or contain a [cookie](https://developer.mozilla.org/en-US/docs/Glossary/Cookie). -- [Spec](https://datatracker.ietf.org/doc/html/rfc6585#section-4) -- [Retry-After](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) +### Examples -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) +The following request is being sent repeatedly in a loop by a client that is misconfigured: + +http + + GET /reports/mdn HTTP/1.1 + Host: example.com + + +In this example, server-wide rate limiting is active when a client exceeds a set threshold of requests per minute. A 429 response is returned with a [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Retry-After) header that indicates that requests will be allowed for this client again in 60 minutes: + +http + + HTTP/1.1 429 Too Many Requests + Content-Type: text/html + Retry-After: 3600 + + + + Too Many Requests + + +

Too Many Requests

+

You're doing that too often! Try again later.

+ + + + +### Specifications + +Specification + +[RFC 6585 +\# section-4](https://www.rfc-editor.org/rfc/rfc6585#section-4) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Retry-After) +* Python solution: [How to avoid HTTP error 429 python](https://stackoverflow.com/questions/22786068/how-to-avoid-http-error-429-too-many-requests-python) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/429) diff --git a/content/431.md b/content/431.md index 067aac46..cd6a7d31 100644 --- a/content/431.md +++ b/content/431.md @@ -1,25 +1,54 @@ ## Description -The HTTP `431 Request Header Fields Too Large` response status code -indicates that the server refuses to process the request because the request's HTTP headers are too long. -The request may be resubmitted after reducing the size of the request headers. +The HTTP **`431 Request Header Fields Too Large`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that the server refuses to process the request because the request's [HTTP headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers) are too long. The request may be resubmitted after reducing the size of the request headers. -`431` can be used when the total size of request headers is too large, -or when a single header field is too large. To help those running into -this error, indicate which of the two is the problem in the response body — ideally, -also include which headers are too large. This lets users attempt to fix the problem, -such as by clearing their cookies. +431 can be used when the total size of request headers is too large or when a single header field is too large. To help clients running into this error, indicate which of the two is the problem in the response body and, ideally, say which headers are too large. This lets people attempt to fix the problem, such as by clearing cookies. Servers will often produce this status if: -- The `Referer` URL is too long -- There are too many Cookies sent in the request +* The [`Referer`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Referer) URL is too long +* There are too many [Cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Cookies) sent in the request -### See Also +### Examples -- [Spec](https://datatracker.ietf.org/doc/html/rfc6585#section-5) -- [Referer header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer) -- [Request header](https://developer.mozilla.org/en-US/docs/Glossary/Request_header) -- [414 URI Too Long](https://http.cat/status/414) +In the following example, the [`Cookie`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cookie) header is too large in the request: -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/431](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/431) +http + + GET /doc HTTP/1.1 + Host: example.com + Cookie: cookie1=value1; cookie2=value2; cookie3=[…] + + +The server responds with a message indicating which header was problematic: + +http + + HTTP/1.1 431 Request Header Fields Too Large + Content-Type: text/html + + + + Request Header Fields Too Large + + +

Request Header Fields Too Large

+

The "Cookie" header was too large.

+ + + + +### Specifications + +Specification + +[RFC 6585 +\# section-5](https://www.rfc-editor.org/rfc/rfc6585#section-5) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`414 URI Too Long`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/414) +* [Request header](https://developer.mozilla.org/en-US/docs/Glossary/Request_header) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/431](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/431) diff --git a/content/451.md b/content/451.md index 3f52c68c..10ff1858 100644 --- a/content/451.md +++ b/content/451.md @@ -1,9 +1,44 @@ ## Description -The HTTP `451 Unavailable For Legal Reasons` client error response code indicates that the user requested a resource that is not available due to legal reasons, such as a web page for which a legal action has been issued. +The HTTP **`451 Unavailable For Legal Reasons`** [client error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) status code indicates that the user requested a resource that is not available due to legal reasons, such as a web page for which a legal action has been issued. -### See Also +### Examples -- [Spec](https://httpwg.org/specs/rfc7725.html#n-451-unavailable-for-legal-reasons) +This example response is taken from the IETF RFC (see below) and contains a reference to [Monty Python's Life of Brian](https://en.wikipedia.org/wiki/Monty_Python's_Life_of_Brian). -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/451](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/451) +**Note:** The [`Link`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Link) header might also contain a `rel="blocked-by"` relation identifying the entity implementing the blockage, not any other entity mandating it. + +Any attempt to identify the entity ultimately responsible for the resource being unavailable belongs in the response body, not in the `rel="blocked-by"` link. This includes the name of the person or organization that made a legal demand resulting in the content's removal. + +http + + HTTP/1.1 451 Unavailable For Legal Reasons + Link: ; rel="blocked-by" + Content-Type: text/html + + + Unavailable For Legal Reasons + +

Unavailable For Legal Reasons

+

This request may not be serviced in the Roman Province + of Judea due to the Lex Julia Majestatis, which disallows + access to resources hosted on servers deemed to be + operated by the People's Front of Judea.

+ + + + +### Specifications + +Specification + +[An HTTP Status Code to Report Legal Obstacles +\# n-451-unavailable-for-legal-reasons](https://httpwg.org/specs/rfc7725.html#n-451-unavailable-for-legal-reasons) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [Wikipedia: HTTP 451](https://en.wikipedia.org/wiki/HTTP_451) +* [Wikipedia: Fahrenheit 451](https://en.wikipedia.org/wiki/Fahrenheit_451) (which gave this status code its number) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/451](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/451) diff --git a/content/500.md b/content/500.md index d7513cfa..87652a06 100644 --- a/content/500.md +++ b/content/500.md @@ -1,12 +1,50 @@ ## Description -The HTTP `500 Internal Server Error` server error response code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request. +The HTTP **`500 Internal Server Error`** [server error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#server_error_responses) status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request. This error is a generic "catch-all" response to server issues, indicating that the server cannot find a more appropriate [5XX error](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#server_error_responses) to respond with. -This error response is a generic "catch-all" response. Usually, this indicates the server cannot find a better `5xx` error code to response. Sometimes, server administrators log error responses like the `500` status code with more details about the request to prevent the error from happening again in the future. +If you're a visitor seeing `500` errors on a web page, these issues require investigation by server owners or administrators. There are many possible causes of `500` errors, including: improper server configuration, out-of-memory (OOM) issues, unhandled exceptions, improper file permissions, or other complex factors. Server administrators may proactively log occurrences of server error responses, like the `500` status code, with details about the initiating requests to improve the stability of a service in the future. -### See Also +### Examples -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.500) -- [500 Internal Server Error](https://http.cat/status/500) +The following request tries to fetch a webpage, but receives a 500 response in return. The response body contains a page describing the server state with a link to a support page for visitors. An identifier is contained in the response body for illustration of a method that may help server administrators narrow down the root cause of the problem: -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) +http + + GET /highlights HTTP/1.1 + Host: example.com + User-Agent: curl/8.6.0 + Accept: */* + + +http + + HTTP/1.1 500 Internal Server Error + Content-Type: text/html; + Content-Length: 123 + + + + + 500 Internal Server Error + + +

Internal Server Error

+

The server was unable to complete your request. Please try again later.

+

If this problem persists, please contact support.

+

Server logs contain details of this error with request ID: ABC-123.

+ + + + +### Specifications + +Specification + +[HTTP Semantics +\# status.500](https://www.rfc-editor.org/rfc/rfc9110#status.500) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/500](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/500) diff --git a/content/501.md b/content/501.md index 8a20d2ad..8934ca8a 100644 --- a/content/501.md +++ b/content/501.md @@ -1,21 +1,43 @@ ## Description -The HTTP `501 Not Implemented` server error response code means that the server does not support the functionality required to fulfill the request. +The HTTP **`501 Not Implemented`** [server error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#server_error_responses) status code means that the server does not support the functionality required to fulfill the request. -This status can also send a `Retry-After` header, telling the requester when to check back to see if the functionality is supported by then. +A response with this status may also include a [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Retry-After) header, telling the client that they can retry the request after the specified time has elapsed. A `501` response is cacheable by default unless caching headers instruct otherwise. -`501` is the appropriate response when the server does not recognize the request method and is incapable of supporting it for any resource. The only methods that servers are required to support (and therefore that must not return `501`) are `GET` and `HEAD`. +`501` is the appropriate response when the server does not recognize the request method and is incapable of supporting it for any resource. Servers are required to support [`GET`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/GET) and [`HEAD`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/HEAD), and therefore must not return `501` in response to requests with these methods. If the server does recognize the method, but intentionally does not allow it, the appropriate response is [`405 Method Not Allowed`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/405). -If the server does recognize the method, but intentionally does not support it, the appropriate response is `405 Method Not Allowed`. +If you have visited a web page and you are seeing `501` errors, these issues require investigation and fixing by server owners or administrators. You can clear your browser cache for the domain, disable proxies if you are using one, or try again later to see if it works as expected. - +A `501` response can occur if proxies cannot not handle request methods used in the context of HTTP Extension Framework ([RFC 2774](https://datatracker.ietf.org/doc/html/rfc2774)) applications. This status can also occur in Web Distributed Authoring and Versioning ([WebDAV](https://developer.mozilla.org/en-US/docs/Glossary/WebDAV)) when a request method (`SEARCH`, `PROPFIND`) does not have a URL handler configured to process it. - +### Examples -### See Also +In the following HTTP Extension Framework example, a client sends a request with a mandatory extension specified in the `C-MAN` header. The [`Connection`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Connection) header specifies that these extensions are to be handled on a [hop-by-hop](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers#hop-by-hop_headers) basis. A proxy refuses to forward the `M-GET` method, and sends a `501` error in response: -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.501) -- [Retry-After](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) -- [405 Method Not Allowed](https://http.cat/status/405) +http -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/501](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/501) + M-GET /document HTTP/1.1 + Host: example.com + C-Man: "http://www.example.org/" + Connection: C-Man + + +http + + HTTP/1.1 501 Not Implemented + + +### Specifications + +Specification + +[HTTP Semantics +\# status.501](https://www.rfc-editor.org/rfc/rfc9110#status.501) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`510 Not Extended`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/510) +* [HTTP 501 errors](https://learn.microsoft.com/en-us/aspnet/web-api/overview/testing-and-debugging/troubleshooting-http-405-errors-after-publishing-web-api-applications) in Microsoft ASP.NET documentation + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/501](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/501) diff --git a/content/502.md b/content/502.md index 5b5339a7..f6f9bf1c 100644 --- a/content/502.md +++ b/content/502.md @@ -1,12 +1,52 @@ ## Description -The HTTP `502 Bad Gateway` server error response code indicates that the server, while acting as a gateway or proxy, received an invalid response from the upstream server. +The HTTP **`502 Bad Gateway`** [server error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#server_error_responses) status code indicates that a server was acting as a gateway or [proxy](https://developer.mozilla.org/en-US/docs/Glossary/Proxy_server) and that it received an invalid response from the upstream server. - +This response is similar to a [`500 Internal Server Error`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/500) response in the sense that it is a generic "catch-all" for server errors. The difference is that it is specific to the point in the request chain that the error has occurred. If the origin server sends a valid HTTP error response to the gateway, the response should be passed on to the client instead of a `502` to make the failure reason transparent. If the proxy or gateway did not receive any HTTP response from the origin, it instead sends a [`504 Gateway Timeout`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/504) to the client. -### See Also +There are many causes of `502` errors, and fixing such problems probably requires investigation by server owners or administrators. Exceptions are client networking errors, particularly if the service works for other visitors, and if clients use VPNs or other custom networking setups. In such cases, clients should check network settings, firewall setup, proxy settings, DNS configuration, etc. -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.502) -- [Gateway](https://en.wikipedia.org/wiki/Gateway_(telecommunications)) +### Examples -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) +The following request tries to fetch a webpage, but receives a `502` response in return. The response body contains a page describing the server state with a link to a support page for visitors. + +http + + GET /highlights HTTP/1.1 + Host: example.com + User-Agent: curl/8.6.0 + Accept: */* + + +http + + HTTP/1.1 502 Bad Gateway + Content-Type: text/html; + Content-Length: 123 + + + + + 502 Bad Gateway + + +

Bad Gateway

+

The server was unable to complete your request. Please try again later.

+

If this problem persists, please contact support.

+ + + + +### Specifications + +Specification + +[HTTP Semantics +\# status.502](https://www.rfc-editor.org/rfc/rfc9110#status.502) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`504 Gateway Timeout`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/504) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/502) diff --git a/content/503.md b/content/503.md index b3f3bb55..a667f061 100644 --- a/content/503.md +++ b/content/503.md @@ -1,17 +1,57 @@ ## Description -The HTTP `503 Service Unavailable` server error response code indicates that the server is not ready to handle the request. +The HTTP **`503 Service Unavailable`** [server error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#server_error_responses) status code indicates that the server is not ready to handle the request. -Common causes are a server that is down for maintenance or that is overloaded. This response should be used for temporary conditions and the `Retry-After` HTTP header should, if possible, contain the estimated time for the recovery of the service. +Common causes are that a server is down for maintenance or overloaded. During maintenance, server administrators may temporarily route all traffic to a `503` page, or this may happen automatically during software updates. In overload cases, some server-side applications will reject requests with a `503` status when resource thresholds like memory, CPU, or connection pool limits are met. Dropping incoming requests creates backpressure that prevents the server's compute resources from being exhausted, avoiding more severe failures. If requests from specific clients are being restricted due to [rate limiting](https://developer.mozilla.org/en-US/docs/Glossary/Rate_limit), the appropriate response is [`429 Too Many Requests`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/429). -Caching-related headers that are sent along with this response should be taken care of, as a `503` status is often a temporary condition and responses shouldn't usually be cached. +This response should be used for temporary conditions and the [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Retry-After) HTTP header should contain the estimated time for the recovery of the service, if possible. - +A user-friendly page explaining the problem should be sent along with this response. -### See Also +**Note:** Caching-related headers sent with this response require special attention; a `503` indicates a temporary issue and responses shouldn't usually be cached as clients may receive outdated error pages after a fix has been deployed. -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.503) -- [Retry-After](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) -- [503 Service Unavailable](https://http.cat/status/503) +### Examples -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) +The following request tries to fetch a webpage, but receives a `503` response. The response body contains a page describing the server state with a link to a support page for visitors. An identifier is contained in the response body for illustration of a method that may help server administrators narrow down the root cause of the problem: + +http + + GET /highlights HTTP/1.1 + Host: example.com + User-Agent: curl/8.6.0 + Accept: */* + + +http + + HTTP/1.1 503 Service Unavailable + Content-Type: text/html; + Content-Length: 123 + + + + + 503 Service Unavailable + + +

503 Service Unavailable

+

The server was unable to complete your request. Please try again later.

+

If this problem persists, please contact support.

+

Server logs contain details of this error with request ID: ABC-123.

+ + + + +### Specifications + +Specification + +[HTTP Semantics +\# status.503](https://www.rfc-editor.org/rfc/rfc9110#status.503) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Retry-After) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/503) diff --git a/content/504.md b/content/504.md index 307097aa..51aa67b0 100644 --- a/content/504.md +++ b/content/504.md @@ -1,13 +1,50 @@ ## Description -The HTTP `504 Gateway Timeout` server error response code indicates that the server, while acting as a gateway or proxy, did not get a response in time from the upstream server that it needed in order to complete the request. +The HTTP **`504 Gateway Timeout`** [server error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#server_error_responses) status code indicates that the server, while acting as a gateway or [proxy](https://developer.mozilla.org/en-US/docs/Glossary/Proxy_server), did not get a response in time from the upstream server in order to complete the request. This is similar to a [`502 Bad Gateway`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/502), except that in a `504` status, the proxy or gateway did not receive any HTTP response from the origin within a certain time. - +There are many causes of `504` errors, and fixing such problems likely requires investigation and debugging by server administrators, or the site may work again at a later time. Exceptions are client networking errors, particularly if the service works for other visitors, and if clients use VPNs or other custom networking setups. In such cases, clients should check network settings, firewall setup, proxy settings, DNS configuration, etc. -### See Also +### Examples -- [Spec](https://www.rfc-editor.org/rfc/rfc9110#status.504) -- [Gateway](https://en.wikipedia.org/wiki/Gateway_(telecommunications)) -- [502 Bad Gateway](https://http.cat/status/502) +The following request tries to fetch a webpage, but receives a `504` response in return. The response body contains a page describing the server state with a link to a support page for visitors. -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504) +http + + GET /highlights HTTP/1.1 + Host: example.com + User-Agent: curl/8.6.0 + Accept: */* + + +http + + HTTP/1.1 504 Gateway Timeout + Content-Type: text/html; + Content-Length: 123 + + + + + 504 Gateway Timeout + + +

Gateway timeout

+

The server did not respond in time. Please try again later.

+

If this problem persists, please contact support.

+ + + + +### Specifications + +Specification + +[HTTP Semantics +\# status.504](https://www.rfc-editor.org/rfc/rfc9110#status.504) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`502 Bad Gateway`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/502) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/504](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/504) diff --git a/content/506.md b/content/506.md index a139fbcf..a8cbf2d0 100644 --- a/content/506.md +++ b/content/506.md @@ -1,12 +1,70 @@ ## Description -The HTTP `506 Variant Also Negotiates` response status code may be given in the context of Transparent Content Negotiation (see RFC 2295). This protocol enables a client to retrieve the best variant of a given resource, where the server supports multiple variants. +The HTTP **`506 Variant Also Negotiates`** [server error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#server_error_responses) status code is returned during content negotiation when there is recursive loop in the process of selecting a resource. -The Variant Also Negotiates status code indicates an internal server configuration error in which the chosen variant is itself configured to engage in content negotiation, so is not a proper negotiation endpoint. +[Agent-driven content negotiation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Content_negotiation#agent-driven_negotiation) enables a client and server to collaboratively decide the best variant of a given resource when the server has multiple variants. A server sends a `506` status code due to server misconfiguration that results in circular references when creating responses. -### See Also +Lack of standardization of how clients automatically choose from responses, and the additional round-trips that slow down client-server interaction mean this mechanism is rarely used. [Server-driven content negotiation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Content_negotiation#server-driven_content_negotiation) is far more common, where a server directly chooses the most appropriate resource for the client based on the request headers ([`Accept-Language`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept-Language), [`Accept`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept), etc.). -- [Spec](https://www.rfc-editor.org/rfc/rfc2295#section-8.1) -- [Content negotiation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation) +### Examples -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/506](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/506) +In the following example, a client requests a page in the `fr` locale using the [`Accept-Language`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept-Language) header. This can be performed using curl: + +bash + + curl -H "Negotiate: trans" -H "Accept-Language: fr;" http://example.com/index + + +This produces the following request: + +http + + GET /index HTTP/1.1 + Host: example.com + User-Agent: curl/8.7.1 + Accept: */* + Negotiate: trans + Accept-Language: fr + + +Due to server misconfiguration, the variant response for `fr` points to a [type map](https://httpd.apache.org/docs/trunk/mod/mod_negotiation.html#typemaps) which itself causes transparent negotiation to be performed. The server may detect this condition by the presence of a `TCN` header in a choice response before it is sent: + +http + + HTTP/1.1 506 Variant Also Negotiates + Date: Mon, 22 Jul 2024 10:00:00 GMT + Server: Apache/2.4.41 (Unix) + Content-Type: text/html; charset=UTF-8 + Content-Length: 233 + TCN: list + Vary: negotiate,accept-language + Alternates: {"index.html.en" 1 {type text/html} {language en} {length 48}}, {"another-map.html.fr.map" 1 {type text/html} {language fr} {length 45}}}} + + + + 506 Variant Also Negotiates + + +

Variant Also Negotiates

+

A variant for the requested resource is itself a negotiable resource. This indicates a configuration error.

+ + + + +### Specifications + +Specification + +[RFC 2295 +\# section-8.1](https://www.rfc-editor.org/rfc/rfc2295#section-8.1) + +### See also + +* [`300 Multiple Choices`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/300) +* [RFC 2295](https://datatracker.ietf.org/doc/html/rfc2295) +* [Content negotiation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Content_negotiation) +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [Content Negotiation](https://httpd.apache.org/docs/2.4/content-negotiation.html) in Apache HTTP Server documentation +* [Apache httpd `mod_negotiation.c` source](https://github.com/apache/httpd/blob/6a2433cb3fbc30c8a55f450a046e4b0f69e73143/modules/mappers/mod_negotiation.c#L2687-L2691) showing conditions that trigger `HTTP_VARIANT_ALSO_VARIES` response. + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/506](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/506) diff --git a/content/507.md b/content/507.md index c79e9d09..6f67e642 100644 --- a/content/507.md +++ b/content/507.md @@ -1,12 +1,55 @@ ## Description -The HTTP `507 Insufficient Storage` response status code may be given in the context of the WebDAV protocol (see RFC 4918). +The HTTP **`507 Insufficient Storage`** [server error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#server_error_responses) status code indicates that an action could not be performed because the server does not have enough available storage to successfully complete the request. -It indicates that a method could not be performed because the server cannot store the representation needed to successfully complete the request. +This status code was first used in the context of Web Distributed Authoring and Versioning ([WebDAV](https://developer.mozilla.org/en-US/docs/Glossary/WebDAV)), but has propagated into other use cases to describe situations where server resources are exhausted. Common causes of this error can be from server directories running out of available space, not enough available RAM for an operation, or internal limits reached (such as application-specific memory limits, for example). The request causing this error does not necessarily need to include content, as it may be a request that would create a resource on the server if it was successful. -### See Also +This issue is considered temporary, as opposed to a [`413 Content Too Large`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/413), which indicates that the client request is too large for the server to process regardless of server resource constraints. -- [Spec](https://www.rfc-editor.org/rfc/rfc4918#section-11.5) -- [WebDAV](https://developer.mozilla.org/en-US/docs/Glossary/WebDAV) +### Examples -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/507](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/507) +The following request attempts to upload a file to a server which has insufficient storage available. The server responds with a `507` to indicate that its resources are exhausted: + +http + + POST /upload HTTP/1.1 + Host: example.com + Content-Type: image/jpeg + Content-Length: 123456 + + [JPG file data] + + +http + + HTTP/1.1 507 Insufficient Storage + Date: Mon, 22 Jul 2024 10:00:00 GMT + Server: Apache/2.4.41 (Unix) + Content-Type: text/html; charset=UTF-8 + Content-Length: 230 + + + + 507 Insufficient Storage + + +

Insufficient Storage

+

The server is unable to store the included resource to complete the request.

+

Please try again later.

+ + + + +### Specifications + +Specification + +[RFC 4918 +\# section-11.5](https://www.rfc-editor.org/rfc/rfc4918#section-11.5) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`413 Content Too Large`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/413) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/507](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/507) diff --git a/content/508.md b/content/508.md index 4fb8c9e0..140b974d 100644 --- a/content/508.md +++ b/content/508.md @@ -1,14 +1,48 @@ ## Description -The HTTP `508 Loop Detected` -response status code may be given in the context of the WebDAV protocol. +The HTTP **`508 Loop Detected`** [server error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#server_error_responses) status code indicates that the entire operation failed because it encountered an infinite loop while processing a request with `Depth: infinity`. -It indicates that the server terminated an operation because it encountered an infinite -loop while processing a request with `"Depth: infinity"`. This status indicates that the entire operation failed. +The status may be given in the context of the Web Distributed Authoring and Versioning ([WebDAV](https://developer.mozilla.org/en-US/docs/Glossary/WebDAV)). It was introduced as a fallback for cases where WebDAV clients do not support [`208 Already Reported`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/208) responses (when requests do not explicitly include a `DAV` header). -### See Also +### Examples -- [Spec](https://www.rfc-editor.org/rfc/rfc5842#section-7.2) -- [WebDAV](https://developer.mozilla.org/en-US/docs/Glossary/WebDAV) +http -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/508](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/508) + PROPFIND /Coll/ HTTP/1.1 + Host: example.com + Depth: infinity + Content-Type: application/xml; charset="utf-8" + Content-Length: 125 + + + + + + + +http + + HTTP/1.1 508 Loop Detected + Content-Type: application/json; charset=utf-8 + Server: Microsoft-IIS/8.0 + Date: Wed, 15 May 2013 02:38:57 GMT + Content-Length: 72 + + { + "Message": "Please check the resources for cyclic references and try again." + } + + +### Specifications + +Specification + +[RFC 5842 +\# section-7.2](https://www.rfc-editor.org/rfc/rfc5842#section-7.2) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [`208 Already Reported`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/208) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/508](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/508) diff --git a/content/510.md b/content/510.md index 3671ee5e..7816d199 100644 --- a/content/510.md +++ b/content/510.md @@ -1,16 +1,33 @@ ## Description -The HTTP `510 Not Extended` -response status code is sent in the context of the HTTP Extension Framework, defined in -RFC 2774. +The HTTP **`510 Not Extended`** [server error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#server_error_responses) status code is sent when the client request declares an HTTP Extension ([RFC 2774](https://datatracker.ietf.org/doc/html/rfc2774)) that should be used to process the request, but the extension is not supported. -In that specification a client may send a request that contains an extension -declaration, that describes the extension to be used. If the server receives such a -request, but any described extensions are not supported for the request, then the server responds with the `510` status code. +### Examples -### See Also +In the following example, a client sends a request with a mandatory extension specified in the `C-MAN` header. The [`Connection`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Connection) header specifies that these extensions are to be handled on a [hop-by-hop](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers#hop-by-hop_headers) basis. A [proxy](https://developer.mozilla.org/en-US/docs/Glossary/Proxy_server) forwards the extended request, but the [`Connection`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Connection) header is stripped out in transit. Because the origin server doesn't receive any information about the `M-GET` method, it sends a `510` in response: -- [Spec](https://www.rfc-editor.org/rfc/rfc2774#section-7) -- [WebDAV](https://developer.mozilla.org/en-US/docs/Glossary/WebDAV) +http -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/510](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/510) + M-GET /document HTTP/1.1 + Host: example.com + C-Man: "http://www.example.org/" + Connection: C-Man + + +http + + HTTP/1.1 510 Not Extended + + +### Specifications + +Specification + +[RFC 2774 +\# section-7](https://www.rfc-editor.org/rfc/rfc2774#section-7) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/510](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/510) diff --git a/content/511.md b/content/511.md index 512e91dc..e5a2e752 100644 --- a/content/511.md +++ b/content/511.md @@ -1,19 +1,45 @@ ## Description -The HTTP `511 Network Authentication Required` response -status code indicates that the client needs to authenticate to gain network access. +The HTTP **`511 Network Authentication Required`** [server error response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#server_error_responses) status code indicates that the client needs to authenticate to gain network access. This status is not generated by origin servers, but by intercepting [proxies](https://developer.mozilla.org/en-US/docs/Glossary/Proxy_server) that control access to a network. -This status is not generated by origin servers, but by intercepting proxies that -control access to the network. +Network operators sometimes require some authentication, acceptance of terms, or other user interaction before granting access (for example in an internet café or at an airport). They often identify clients who have not done so using their Media Access Control (MAC) addresses. -Network operators sometimes require some authentication, acceptance of terms, or other -user interaction before granting access (for example in an internet café or at an -airport). They often identify clients who have not done so using their Media Access -Control (MAC) addresses. +### Examples -### See Also +In the following example, a client tries to access a resource on a network. The request is not authenticated, and a proxy sends a `511` status code to prompt the visitor to log in. The `511` ensures that non-browser clients will not interpret the response as being from the origin server. Browsers are redirected automatically via the [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta) tag after 10 seconds, or by clicking the link in the response body: -- [Spec](https://www.rfc-editor.org/rfc/rfc6585#section-6) -- [Proxy server](https://developer.mozilla.org/en-US/docs/Glossary/Proxy_server) +http -**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/511](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/511) + GET /document HTTP/1.1 + Host: example.com + + +http + + HTTP/1.1 511 Network Authentication Required + Content-Type: text/html + + + + Network Authentication Required + + + +

You need to authenticate with the local network in order to gain access.

+ + + + +### Specifications + +Specification + +[RFC 6585 +\# section-6](https://www.rfc-editor.org/rfc/rfc6585#section-6) + +### See also + +* [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status) +* [Proxy server](https://developer.mozilla.org/en-US/docs/Glossary/Proxy_server) + +**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/511](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/511) diff --git a/lib/statuses.js b/lib/statuses.js index 956db3da..d06bbe97 100644 --- a/lib/statuses.js +++ b/lib/statuses.js @@ -5,25 +5,31 @@ const statuses = { 101: { code: 101, message: 'Switching Protocols' }, 102: { code: 102, message: 'Processing' }, 103: { code: 103, message: 'Early Hints'}, + 200: { code: 200, message: 'OK' }, 201: { code: 201, message: 'Created' }, 202: { code: 202, message: 'Accepted' }, 203: { code: 203, message: 'Non-Authoritative Information' }, 204: { code: 204, message: 'No Content' }, - 206: { code: 206, message: 'Partial Content' }, 205: { code: 205, message: 'Reset Content' }, + 206: { code: 206, message: 'Partial Content' }, 207: { code: 207, message: 'Multi-Status' }, 208: { code: 208, message: 'Already Reported' }, + 214: { code: 214, message: 'Transformation Applied' }, + 226: { code: 226, message: 'IM Used' }, + 300: { code: 300, message: 'Multiple Choices' }, 301: { code: 301, message: 'Moved Permanently' }, 302: { code: 302, message: 'Found' }, 303: { code: 303, message: 'See Other' }, 304: { code: 304, message: 'Not Modified' }, 305: { code: 305, message: 'Use Proxy' }, + 307: { code: 307, message: 'Temporary Redirect' }, 308: { code: 308, message: 'Permanent Redirect' }, + 400: { code: 400, message: 'Bad Request' }, 401: { code: 401, message: 'Unauthorized' }, 402: { code: 402, message: 'Payment Required' }, @@ -51,33 +57,44 @@ const statuses = { 424: { code: 424, message: 'Failed Dependency' }, 425: { code: 425, message: 'Too Early' }, 426: { code: 426, message: 'Upgrade Required' }, + 428: { code: 428, message: 'Precondition Required' }, 429: { code: 429, message: 'Too Many Requests' }, + 431: { code: 431, message: 'Request Header Fields Too Large' }, + 444: { code: 444, message: 'No Response' }, + 450: { code: 450, message: 'Blocked by Windows Parental Controls' }, 451: { code: 451, message: 'Unavailable For Legal Reasons' }, + 495: { code: 495, message: 'SSL Certificate Error' }, 496: { code: 496, message: 'SSL Certificate Required' }, 497: { code: 497, message: 'HTTP Request Sent to HTTPS Port' }, 498: { code: 498, message: 'Token expired/invalid' }, 499: { code: 499, message: 'Client Closed Request' }, + 500: { code: 500, message: 'Internal Server Error' }, 501: { code: 501, message: 'Not Implemented' }, 502: { code: 502, message: 'Bad Gateway' }, 503: { code: 503, message: 'Service Unavailable' }, 504: { code: 504, message: 'Gateway Timeout' }, + 506: { code: 506, message: 'Variant Also Negotiates' }, 507: { code: 507, message: 'Insufficient Storage' }, 508: { code: 508, message: 'Loop Detected' }, 509: { code: 509, message: 'Bandwidth Limit Exceeded' }, 510: { code: 510, message: 'Not Extended' }, 511: { code: 511, message: 'Network Authentication Required' }, + 521: { code: 521, message: 'Web Server Is Down' }, 522: { code: 522, message: 'Connection Timed Out' }, 523: { code: 523, message: 'Origin Is Unreachable' }, + 525: { code: 525, message: 'SSL Handshake Failed' }, + 530: { code: 530, message: 'Site Frozen' }, + 599: { code: 599, message: 'Network Connect Timeout Error' }, } diff --git a/package-lock.json b/package-lock.json index f38854c8..6b585204 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,8 @@ "devDependencies": { "all-contributors-cli": "^6.26.1", "jsdom": "^24.1.0", - "p-map": "^7.0.2" + "p-map": "^7.0.2", + "turndown": "^7.2.2" } }, "node_modules/@alloc/quick-lru": { @@ -45,37 +46,37 @@ } }, "node_modules/@babel/runtime": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", - "integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==", + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.6.tgz", + "integrity": "sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA==", "dev": true, "license": "MIT", - "dependencies": { - "regenerator-runtime": "^0.14.0" - }, "engines": { "node": ">=6.9.0" } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", "license": "MIT", "dependencies": { - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^3.4.3" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, + "funding": { + "url": "https://opencollective.com/eslint" + }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, "node_modules/@eslint-community/regexpp": { - "version": "4.11.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.0.tgz", - "integrity": "sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", "license": "MIT", "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -257,27 +258,36 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@mixmark-io/domino": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@mixmark-io/domino/-/domino-2.2.0.tgz", + "integrity": "sha512-Y28PR25bHXUg88kCV7nivXrP2Nj2RueZ3/l/jdx6J9f8J4nsEGcgX0Qe6lt7Pa+J79+kPiJU3LguR6O/6zrLOw==", + "dev": true, + "license": "BSD-2-Clause" + }, "node_modules/@next/env": { - "version": "14.2.21", - "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.21.tgz", - "integrity": "sha512-lXcwcJd5oR01tggjWJ6SrNNYFGuOOMB9c251wUNkjCpkoXOPkDeF/15c3mnVlBqrW4JJXb2kVxDFhC4GduJt2A==" + "version": "14.2.35", + "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.35.tgz", + "integrity": "sha512-DuhvCtj4t9Gwrx80dmz2F4t/zKQ4ktN8WrMwOuVzkJfBilwAwGr6v16M5eI8yCuZ63H9TTuEU09Iu2HqkzFPVQ==", + "license": "MIT" }, "node_modules/@next/eslint-plugin-next": { - "version": "14.2.4", - "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-14.2.4.tgz", - "integrity": "sha512-svSFxW9f3xDaZA3idQmlFw7SusOuWTpDTAeBlO3AEPDltrraV+lqs7mAc6A27YdnpQVVIA3sODqUAAHdWhVWsA==", + "version": "14.2.35", + "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-14.2.35.tgz", + "integrity": "sha512-Jw9A3ICz2183qSsqwi7fgq4SBPiNfmOLmTPXKvlnzstUwyvBrtySiY+8RXJweNAs9KThb1+bYhZh9XWcNOr2zQ==", "license": "MIT", "dependencies": { "glob": "10.3.10" } }, "node_modules/@next/swc-darwin-arm64": { - "version": "14.2.21", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.21.tgz", - "integrity": "sha512-HwEjcKsXtvszXz5q5Z7wCtrHeTTDSTgAbocz45PHMUjU3fBYInfvhR+ZhavDRUYLonm53aHZbB09QtJVJj8T7g==", + "version": "14.2.33", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.33.tgz", + "integrity": "sha512-HqYnb6pxlsshoSTubdXKu15g3iivcbsMXg4bYpjL2iS/V6aQot+iyF4BUc2qA/J/n55YtvE4PHMKWBKGCF/+wA==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "darwin" @@ -287,12 +297,13 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "14.2.21", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.21.tgz", - "integrity": "sha512-TSAA2ROgNzm4FhKbTbyJOBrsREOMVdDIltZ6aZiKvCi/v0UwFmwigBGeqXDA97TFMpR3LNNpw52CbVelkoQBxA==", + "version": "14.2.33", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.33.tgz", + "integrity": "sha512-8HGBeAE5rX3jzKvF593XTTFg3gxeU4f+UWnswa6JPhzaR6+zblO5+fjltJWIZc4aUalqTclvN2QtTC37LxvZAA==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "darwin" @@ -302,12 +313,13 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "14.2.21", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.21.tgz", - "integrity": "sha512-0Dqjn0pEUz3JG+AImpnMMW/m8hRtl1GQCNbO66V1yp6RswSTiKmnHf3pTX6xMdJYSemf3O4Q9ykiL0jymu0TuA==", + "version": "14.2.33", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.33.tgz", + "integrity": "sha512-JXMBka6lNNmqbkvcTtaX8Gu5by9547bukHQvPoLe9VRBx1gHwzf5tdt4AaezW85HAB3pikcvyqBToRTDA4DeLw==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -317,12 +329,13 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "14.2.21", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.21.tgz", - "integrity": "sha512-Ggfw5qnMXldscVntwnjfaQs5GbBbjioV4B4loP+bjqNEb42fzZlAaK+ldL0jm2CTJga9LynBMhekNfV8W4+HBw==", + "version": "14.2.33", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.33.tgz", + "integrity": "sha512-Bm+QulsAItD/x6Ih8wGIMfRJy4G73tu1HJsrccPW6AfqdZd0Sfm5Imhgkgq2+kly065rYMnCOxTBvmvFY1BKfg==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -332,12 +345,13 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "14.2.21", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.21.tgz", - "integrity": "sha512-uokj0lubN1WoSa5KKdThVPRffGyiWlm/vCc/cMkWOQHw69Qt0X1o3b2PyLLx8ANqlefILZh1EdfLRz9gVpG6tg==", + "version": "14.2.33", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.33.tgz", + "integrity": "sha512-FnFn+ZBgsVMbGDsTqo8zsnRzydvsGV8vfiWwUo1LD8FTmPTdV+otGSWKc4LJec0oSexFnCYVO4hX8P8qQKaSlg==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -347,12 +361,13 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "14.2.21", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.21.tgz", - "integrity": "sha512-iAEBPzWNbciah4+0yI4s7Pce6BIoxTQ0AGCkxn/UBuzJFkYyJt71MadYQkjPqCQCJAFQ26sYh7MOKdU+VQFgPg==", + "version": "14.2.33", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.33.tgz", + "integrity": "sha512-345tsIWMzoXaQndUTDv1qypDRiebFxGYx9pYkhwY4hBRaOLt8UGfiWKr9FSSHs25dFIf8ZqIFaPdy5MljdoawA==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -362,12 +377,13 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "14.2.21", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.21.tgz", - "integrity": "sha512-plykgB3vL2hB4Z32W3ktsfqyuyGAPxqwiyrAi2Mr8LlEUhNn9VgkiAl5hODSBpzIfWweX3er1f5uNpGDygfQVQ==", + "version": "14.2.33", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.33.tgz", + "integrity": "sha512-nscpt0G6UCTkrT2ppnJnFsYbPDQwmum4GNXYTeoTIdsmMydSKFz9Iny2jpaRupTb+Wl298+Rh82WKzt9LCcqSQ==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -377,12 +393,13 @@ } }, "node_modules/@next/swc-win32-ia32-msvc": { - "version": "14.2.21", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.21.tgz", - "integrity": "sha512-w5bacz4Vxqrh06BjWgua3Yf7EMDb8iMcVhNrNx8KnJXt8t+Uu0Zg4JHLDL/T7DkTCEEfKXO/Er1fcfWxn2xfPA==", + "version": "14.2.33", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.33.tgz", + "integrity": "sha512-pc9LpGNKhJ0dXQhZ5QMmYxtARwwmWLpeocFmVG5Z0DzWq5Uf0izcI8tLc+qOpqxO1PWqZ5A7J1blrUIKrIFc7Q==", "cpu": [ "ia32" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -392,12 +409,13 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "14.2.21", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.21.tgz", - "integrity": "sha512-sT6+llIkzpsexGYZq8cjjthRyRGe5cJVhqh12FmlbxHqna6zsDDK8UNaV7g41T6atFHCJUPeLb3uyAwrBwy0NA==", + "version": "14.2.33", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.33.tgz", + "integrity": "sha512-nOjfZMy8B94MdisuzZo9/57xuFVLHJaDj5e/xrduJp9CV2/HrfxTRH2fbyLe+K9QT41WBLUd4iXX3R7jBp0EUg==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -552,58 +570,152 @@ "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "license": "MIT" }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.55.0.tgz", + "integrity": "sha512-1y/MVSz0NglV1ijHC8OT49mPJ4qhPYjiK08YUQVbIOyu+5k862LKUHFkpKHWu//zmr7hDR2rhwUm6gnCGNmGBQ==", + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.12.2", + "@typescript-eslint/scope-manager": "8.55.0", + "@typescript-eslint/type-utils": "8.55.0", + "@typescript-eslint/utils": "8.55.0", + "@typescript-eslint/visitor-keys": "8.55.0", + "ignore": "^7.0.5", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.4.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.55.0", + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, "node_modules/@typescript-eslint/parser": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.2.0.tgz", - "integrity": "sha512-5FKsVcHTk6TafQKQbuIVkXq58Fnbkd2wDL4LB7AURN7RUOu1utVP+G8+6u3ZhEroW3DF6hyo3ZEXxgKgp4KeCg==", - "license": "BSD-2-Clause", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.55.0.tgz", + "integrity": "sha512-4z2nCSBfVIMnbuu8uinj+f0o4qOeggYJLbjpPHka3KH1om7e+H9yLKTYgksTaHcGco+NClhhY2vyO3HsMH1RGw==", + "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "7.2.0", - "@typescript-eslint/types": "7.2.0", - "@typescript-eslint/typescript-estree": "7.2.0", - "@typescript-eslint/visitor-keys": "7.2.0", - "debug": "^4.3.4" + "@typescript-eslint/scope-manager": "8.55.0", + "@typescript-eslint/types": "8.55.0", + "@typescript-eslint/typescript-estree": "8.55.0", + "@typescript-eslint/visitor-keys": "8.55.0", + "debug": "^4.4.3" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.56.0" + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.55.0.tgz", + "integrity": "sha512-zRcVVPFUYWa3kNnjaZGXSu3xkKV1zXy8M4nO/pElzQhFweb7PPtluDLQtKArEOGmjXoRjnUZ29NjOiF0eCDkcQ==", + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.55.0", + "@typescript-eslint/types": "^8.55.0", + "debug": "^4.4.3" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.2.0.tgz", - "integrity": "sha512-Qh976RbQM/fYtjx9hs4XkayYujB/aPwglw2choHmf3zBjB4qOywWSdt9+KLRdHubGcoSwBnXUH2sR3hkyaERRg==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.55.0.tgz", + "integrity": "sha512-fVu5Omrd3jeqeQLiB9f1YsuK/iHFOwb04bCtY4BSCLgjNbOD33ZdV6KyEqplHr+IlpgT0QTZ/iJ+wT7hvTx49Q==", + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.55.0", + "@typescript-eslint/visitor-keys": "8.55.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.55.0.tgz", + "integrity": "sha512-1R9cXqY7RQd7WuqSN47PK9EDpgFUK3VqdmbYrvWJZYDd0cavROGn+74ktWBlmJ13NXUQKlZ/iAEQHI/V0kKe0Q==", + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.55.0.tgz", + "integrity": "sha512-x1iH2unH4qAt6I37I2CGlsNs+B9WGxurP2uyZLRz6UJoZWDBx9cJL1xVN/FiOmHEONEg6RIufdvyT0TEYIgC5g==", "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.2.0", - "@typescript-eslint/visitor-keys": "7.2.0" + "@typescript-eslint/types": "8.55.0", + "@typescript-eslint/typescript-estree": "8.55.0", + "@typescript-eslint/utils": "8.55.0", + "debug": "^4.4.3", + "ts-api-utils": "^2.4.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/types": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.2.0.tgz", - "integrity": "sha512-XFtUHPI/abFhm4cbCDc5Ykc8npOKBSJePY3a3s+lwumt7XWJuzP5cZcfZ610MIPHjQjNsOLlYK8ASPaNG8UiyA==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.55.0.tgz", + "integrity": "sha512-ujT0Je8GI5BJWi+/mMoR0wxwVEQaxM+pi30xuMiJETlX80OPovb2p9E8ss87gnSVtYXtJoU9U1Cowcr6w2FE0w==", "license": "MIT", "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -611,46 +723,45 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.2.0.tgz", - "integrity": "sha512-cyxS5WQQCoBwSakpMrvMXuMDEbhOo9bNHHrNcEWis6XHx6KF518tkF1wBvKIn/tpq5ZpUYK7Bdklu8qY0MsFIA==", - "license": "BSD-2-Clause", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.55.0.tgz", + "integrity": "sha512-EwrH67bSWdx/3aRQhCoxDaHM+CrZjotc2UCCpEDVqfCE+7OjKAGWNY2HsCSTEVvWH2clYQK8pdeLp42EVs+xQw==", + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.2.0", - "@typescript-eslint/visitor-keys": "7.2.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "9.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "@typescript-eslint/project-service": "8.55.0", + "@typescript-eslint/tsconfig-utils": "8.55.0", + "@typescript-eslint/types": "8.55.0", + "@typescript-eslint/visitor-keys": "8.55.0", + "debug": "^4.4.3", + "minimatch": "^9.0.5", + "semver": "^7.7.3", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.4.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" @@ -662,23 +773,58 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/@typescript-eslint/utils": { + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.55.0.tgz", + "integrity": "sha512-BqZEsnPGdYpgyEIkDC1BadNY8oMwckftxBT+C8W0g1iKPdeqKZBtTfnvcq0nf60u7MkjFO8RBvpRGZBPw4L2ow==", + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.55.0", + "@typescript-eslint/types": "8.55.0", + "@typescript-eslint/typescript-estree": "8.55.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.2.0.tgz", - "integrity": "sha512-c6EIQRHhcpl6+tO8EMR+kjkkV+ugUNXOmeASA1rlzkd8EPIriavpWoiEz1HR/VLhbVIdhqnV6E7JZm00cBDx2A==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.55.0.tgz", + "integrity": "sha512-AxNRwEie8Nn4eFS1FzDMJWIISMGoXMb037sgCBJ3UR6o0fQTzr2tqN9WT+DkWJPhIdQCfV7T6D387566VtnCJA==", "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.2.0", - "eslint-visitor-keys": "^3.4.1" + "@typescript-eslint/types": "8.55.0", + "eslint-visitor-keys": "^4.2.1" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", @@ -892,15 +1038,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/array.prototype.findlast": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", @@ -1146,9 +1283,9 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -1229,6 +1366,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -1489,9 +1639,9 @@ "license": "MIT" }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "license": "MIT", "dependencies": { "path-key": "^3.1.0", @@ -1612,12 +1762,12 @@ } }, "node_modules/debug": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", - "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -1768,18 +1918,6 @@ "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==", "license": "Apache-2.0" }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "license": "MIT", - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/dlv": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", @@ -1798,6 +1936,20 @@ "node": ">=6.0.0" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -1902,13 +2054,10 @@ } }, "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", "license": "MIT", - "dependencies": { - "get-intrinsic": "^1.2.4" - }, "engines": { "node": ">= 0.4" } @@ -1968,9 +2117,9 @@ } }, "node_modules/es-object-atoms": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", - "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", "license": "MIT", "dependencies": { "es-errors": "^1.3.0" @@ -1980,14 +2129,15 @@ } }, "node_modules/es-set-tostringtag": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", - "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", "license": "MIT", "dependencies": { - "get-intrinsic": "^1.2.4", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", "has-tostringtag": "^1.0.2", - "hasown": "^2.0.1" + "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -2096,14 +2246,15 @@ } }, "node_modules/eslint-config-next": { - "version": "14.2.4", - "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-14.2.4.tgz", - "integrity": "sha512-Qr0wMgG9m6m4uYy2jrYJmyuNlYZzPRQq5Kvb9IDlYwn+7yq6W6sfMNFgb+9guM1KYwuIo6TIaiFhZJ6SnQ/Efw==", + "version": "14.2.35", + "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-14.2.35.tgz", + "integrity": "sha512-BpLsv01UisH193WyT/1lpHqq5iJ/Orfz9h/NOOlAmTUq4GY349PextQ62K4XpnaM9supeiEn3TaOTeQO07gURg==", "license": "MIT", "dependencies": { - "@next/eslint-plugin-next": "14.2.4", + "@next/eslint-plugin-next": "14.2.35", "@rushstack/eslint-patch": "^1.3.3", - "@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || 7.0.0 - 7.2.0", + "@typescript-eslint/eslint-plugin": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", + "@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", "eslint-import-resolver-node": "^0.3.6", "eslint-import-resolver-typescript": "^3.5.2", "eslint-plugin-import": "^2.28.1", @@ -2640,14 +2791,16 @@ } }, "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", "dev": true, "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", "mime-types": "^2.1.12" }, "engines": { @@ -2734,16 +2887,21 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "license": "MIT", "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -2752,6 +2910,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/get-symbol-description": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", @@ -2816,9 +2987,9 @@ } }, "node_modules/glob/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" @@ -2870,33 +3041,13 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "license": "MIT", - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", "license": "MIT", - "dependencies": { - "get-intrinsic": "^1.1.3" + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2957,9 +3108,9 @@ } }, "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -3769,9 +3920,9 @@ "license": "MIT" }, "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "license": "MIT", "dependencies": { "argparse": "^2.0.1" @@ -3952,9 +4103,9 @@ } }, "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "version": "4.17.23", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", + "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==", "dev": true, "license": "MIT" }, @@ -3985,6 +4136,15 @@ "node": ">=18" } }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/mdast-util-from-markdown": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.1.tgz", @@ -4010,9 +4170,9 @@ } }, "node_modules/mdast-util-to-hast": { - "version": "13.2.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz", - "integrity": "sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA==", + "version": "13.2.1", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.1.tgz", + "integrity": "sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA==", "license": "MIT", "dependencies": { "@types/hast": "^3.0.0", @@ -4570,9 +4730,9 @@ } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, "node_modules/mute-stream": { @@ -4594,9 +4754,9 @@ } }, "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", "funding": [ { "type": "github", @@ -4618,11 +4778,12 @@ "license": "MIT" }, "node_modules/next": { - "version": "14.2.21", - "resolved": "https://registry.npmjs.org/next/-/next-14.2.21.tgz", - "integrity": "sha512-rZmLwucLHr3/zfDMYbJXbw0ZeoBpirxkXuvsJbk7UPorvPYZhP7vq7aHbKnU7dQNCYIimRrbB2pp3xmf+wsYUg==", + "version": "14.2.35", + "resolved": "https://registry.npmjs.org/next/-/next-14.2.35.tgz", + "integrity": "sha512-KhYd2Hjt/O1/1aZVX3dCwGXM1QmOV4eNM2UTacK5gipDdPN/oHHK/4oVGy7X8GMfPMsUTUEmGlsy0EY1YGAkig==", + "license": "MIT", "dependencies": { - "@next/env": "14.2.21", + "@next/env": "14.2.35", "@swc/helpers": "0.5.5", "busboy": "1.6.0", "caniuse-lite": "^1.0.30001579", @@ -4637,15 +4798,15 @@ "node": ">=18.17.0" }, "optionalDependencies": { - "@next/swc-darwin-arm64": "14.2.21", - "@next/swc-darwin-x64": "14.2.21", - "@next/swc-linux-arm64-gnu": "14.2.21", - "@next/swc-linux-arm64-musl": "14.2.21", - "@next/swc-linux-x64-gnu": "14.2.21", - "@next/swc-linux-x64-musl": "14.2.21", - "@next/swc-win32-arm64-msvc": "14.2.21", - "@next/swc-win32-ia32-msvc": "14.2.21", - "@next/swc-win32-x64-msvc": "14.2.21" + "@next/swc-darwin-arm64": "14.2.33", + "@next/swc-darwin-x64": "14.2.33", + "@next/swc-linux-arm64-gnu": "14.2.33", + "@next/swc-linux-arm64-musl": "14.2.33", + "@next/swc-linux-x64-gnu": "14.2.33", + "@next/swc-linux-x64-musl": "14.2.33", + "@next/swc-win32-arm64-msvc": "14.2.33", + "@next/swc-win32-ia32-msvc": "14.2.33", + "@next/swc-win32-x64-msvc": "14.2.33" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", @@ -5102,15 +5263,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/pegjs": { "version": "0.10.0", "resolved": "https://registry.npmjs.org/pegjs/-/pegjs-0.10.0.tgz", @@ -5494,13 +5646,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/regenerator-runtime": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", - "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", - "dev": true, - "license": "MIT" - }, "node_modules/regexp.prototype.flags": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", @@ -5837,9 +5982,9 @@ } }, "node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -5938,15 +6083,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/source-map-js": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", @@ -6328,6 +6464,51 @@ "dev": true, "license": "MIT" }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -6403,15 +6584,15 @@ } }, "node_modules/ts-api-utils": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", - "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.4.0.tgz", + "integrity": "sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA==", "license": "MIT", "engines": { - "node": ">=16" + "node": ">=18.12" }, "peerDependencies": { - "typescript": ">=4.2.0" + "typescript": ">=4.8.4" } }, "node_modules/ts-interface-checker": { @@ -6438,6 +6619,16 @@ "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", "license": "0BSD" }, + "node_modules/turndown": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/turndown/-/turndown-7.2.2.tgz", + "integrity": "sha512-1F7db8BiExOKxjSMU2b7if62D/XOyQyZbPKq/nUwopfgnHlqXHqQ0lvfUTeUIr1lZJzOPFn43dODyMSIfvWRKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@mixmark-io/domino": "^2.2.0" + } + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", diff --git a/package.json b/package.json index 6296a3de..15955d8a 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,7 @@ "scripts": { "dev": "next dev", "build": "next build && rm out/404.html && cp out/ca.html out/ca/index.html && cp out/ca.txt out/ca/index.txt", - "start": "next start", "lint": "next lint", - "export": "next export", "deploy": "./scripts/deploy.sh", "scrapper": "node ./scripts/scrapper.js" }, @@ -33,6 +31,7 @@ "devDependencies": { "all-contributors-cli": "^6.26.1", "jsdom": "^24.1.0", - "p-map": "^7.0.2" + "p-map": "^7.0.2", + "turndown": "^7.2.2" } } diff --git a/scripts/scrapper.js b/scripts/scrapper.js index 74ade3b2..d0ca8adf 100644 --- a/scripts/scrapper.js +++ b/scripts/scrapper.js @@ -1,31 +1,83 @@ const fs = require('fs/promises'); -const pMap = require('p-map'); +const pMap = require('p-map').default; const jsdom = require('jsdom'); +const TurndownService = require('turndown'); const statuses = require('../lib/statuses'); +const turndownService = new TurndownService(); -const extractDescription = (html) => { +turndownService.addRule('customHeadings', { + filter: function (node) { + return ( + ['H1', 'H2'].includes(node.nodeName) + ); + }, + + replacement: function (_content, node) { + if (node.nodeName === 'H1') // Always output "## Description" for h1 + return '\n## Description\n'; + + if (node.nodeName === 'H2') // Output h2 as h3 + return '\n### ' + node.textContent.trim() + '\n'; + + return ''; + } +}); + +const extractMainContent = (html, statusCode) => { const dom = new jsdom.JSDOM(html); const doc = dom.window.document; - return doc.querySelector('main .section-content').textContent; + const main = doc.querySelector('main.layout__content'); + if (!main) { + console.warn(`No
found for code ${statusCode}`); + return null; + } + + const header = main.querySelector('.reference-layout__header'); + const body = main.querySelector('.reference-layout__body'); + if (!header && !body) { + console.warn(`No header/body found for code ${statusCode}`); + return null; + } + + // Remove the "Status" section if present + const statusSection = body && body.querySelector('section[aria-labelledby="status"]'); + if (statusSection) statusSection.remove(); + + // throw away h3 and beyond (hopefully we never see h7) + body.querySelectorAll('h3, h4, h5, h6').forEach(el => el.remove()); + + // Remove article-footer section if present + const footer = body && body.querySelector('.article-footer'); + if (footer) footer.remove(); + + // Combine header and body HTML + const combinedHtml = + (header ? header.innerHTML : '') + + (body ? body.innerHTML : ''); + return combinedHtml.trim(); }; -const fetchMDNAndSave = (statusCode) => { +const fetchMDNAndSave = async (statusCode) => { console.log(`Fetching description for code ${statusCode}...`); - return fetch( - `https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/${statusCode}` - ) - .then((response) => { - if (response.status !== 200) - throw new Error(`${response.statusText} ${statusCode}`); - return response.text(); - }) - .then(extractDescription) - .then((description) => { - return fs.writeFile(`./content/${statusCode}.md`, description, 'utf-8'); - }); + const url = `https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/${statusCode}`; + const response = await fetch(url); + if (!response.ok) { + console.warn(`Not ok: ${statusCode} (${response.status})`); + return; + } + + const html = await response.text(); + const mainHtml = extractMainContent(html, statusCode); + if (!mainHtml) return; + + const markdown = turndownService.turndown(mainHtml) + .replace(/\]\(\/([^)]+)\)/g,'](https://developer.mozilla.org/$1)') // absolute links + .replace(/^([*-])\s{2,}/gm, '$1 ') // spaces after list markers + .replace(/\s*$/, `\n\n**Source:** [${url}](${url})\n`); + await fs.writeFile(`./content/${statusCode}.md`, markdown, 'utf-8'); }; (async () => { @@ -33,4 +85,5 @@ const fetchMDNAndSave = (statusCode) => { concurrency: 5, stopOnError: false, }); + process.exit(0); })();