Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Support] Updates 1xx page #18729

Merged
merged 4 commits into from
Dec 13, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,49 @@ title: 1xx Informational

---

## Overview
The 1xx Informational status codes serve as interim responses that provide connection status updates without completing the request-response cycle. These codes are not intended for final actions but rather for indicating that the request is being processed or additional steps are required.
angelampcosta marked this conversation as resolved.
Show resolved Hide resolved

1xx codes are often interim responses for sharing connection status information. Not intended for final request or response action. Requirements from the server:
The requirements the server must follow when sending 1xx Informational status codes in response to a client's request include:

* Responses all terminated by the first empty line after status line
- Responses must be terminated by the first empty line following the status line.
- 1xx responses are not supported by HTTP/1.0; the origin server should never send a 1xx response to an HTTP/1.0 client.

* Not used for HTTP 1.0. Origin server should never send 1xx response to HTTP 1.0 client
Cloudflare forwards all 1xx responses from origin servers but does not generate them directly.

Cloudflare will forward all of these responses and never generates this response.
## 100 Continue ([RFC7231](https://tools.ietf.org/html/rfc7231))

**100 Continue (**[**RFC7231**](https://tools.ietf.org/html/rfc7231)**)**
The 100 Continue status indicates that the server has received the request headers and is ready for the client to send the request body.

Confirmation of the initial request to send a response body. The origin server is willing to accept the request (based on the request headers). This is returned before the client typically sends the response body. This prevents clients from sending unnecessary or unusable data. Required from server: If the client sends `Expect: 100-continue` header, the server must respond immediately with either `100 Continue` and continue to read from the input stream or send another response code. Cloudflare uses Keep-Alive connections so this response should not be necessary
### Common use cases

**101 Switching Protocols (**[**RFC7231**](https://tools.ietf.org/html/rfc7231)**)**
Allows clients to verify if the server will accept their request headers before sending a potentially large or unusable request body, optimizing data flow.

Origin server accepts the client’s request to switch protocols. Client request either contained `Upgrade` in a header field or there was a change in the application protocol being used on this connection. If using Upgrade header field, the server has agreed to upgrade to a protocol that is higher on the client’s priority list than the current protocol being used. Origin server must also respond with a `Upgrade` header field to indicate the new protocol(s) to which the connection is being switched It is assumed that this switch will be advantageous to both the client and the server. Most common use case is with websockets. For information about Cloudflare’s Websockets, refer to [Cloudflare Now Supports Websockets](https://blog.cloudflare.com/cloudflare-now-supports-websockets/).
When a client includes the `Expect: 100-continue` header, is requesting a confirmation before sending the request body, prompting the server to respond immediately with either `100 Continue` to proceed or an appropriate status code (for example, 401 Unauthorized or 413 Payload Too Large) if the request is unacceptable.
angelampcosta marked this conversation as resolved.
Show resolved Hide resolved

**102 Processing (**[**RFC2518**](https://tools.ietf.org/html/rfc2518)**)**
### Cloudflare-specific information

Server has received the client’s completed response, but is expecting to take more time to process ( e.g. > 20 seconds). The server must send a final response after the request has been completed. Used for only HTTP 1.1 and higher.
Cloudflare uses Keep-Alive connections to maintain persistent communication between clients and servers, making the `100 Continue` response typically unnecessary, as Keep-Alive reduces overhead and eliminates the need for intermediate confirmations.

If Cloudflare does not receive a response in 100 seconds or less after a 102, an [Error 522: Connection Timed Out](https://support.cloudflare.com/hc/articles/115003011431#522error) will be generated. 102 responses can be used to prevent [Error 524: A timeout error](https://support.cloudflare.com/hc/articles/115003011431#524error).
## 101 Switching Protocols ([RFC7231](https://tools.ietf.org/html/rfc7231))

The 101 Switching Protocols status code indicates that the origin server accepts the client's request to switch protocols.

### Common use cases

The 101 Switching Protocols status code indicates that the server has accepted the client's request to change protocols, either by including an `Upgrade` header or through a change in the application protocol on the connection. When the `Upgrade` header is used, the server agrees to switch to a protocol higher on the client's priority list and responds with an `Upgrade` header to specify the new protocol(s). This change is assumed to benefit both the client and the server, with WebSockets being the most common use case.

### Cloudflare-specific information

Cloudflare supports WebSocket connections, which often involve the 101 Switching Protocols status code. The protocol switch allows clients to establish a WebSocket connection for real-time, bidirectional communication. For information about Cloudflare's Websockets, refer to [Cloudflare Now Supports Websockets](https://blog.cloudflare.com/cloudflare-now-supports-websockets/).

## 102 Processing ([RFC2518](https://tools.ietf.org/html/rfc2518))

102 Processing status code indicates that the server has received the request and is currently processing it, but the final response is not yet ready. This status code is only applicable to HTTP/1.1 and higher.

### Common use cases

The 102 Processing status code is commonly used in scenarios requiring long-running operations, such as complex database transactions or large file processing. It helps maintain the connection during extended processing times, typically exceeding 20 seconds, ensuring efficient communication between the client and server throughout the operation.

### Cloudflare-specific information

If Cloudflare receives a 102 Processing response, it expects a final response within 100 seconds. Failure to receive this response results in an [Error 522: Connection Timed Out](https://support.cloudflare.com/hc/articles/115003011431#522error). However, sending interim 102 Processing responses can help prevent [Error 524: A timeout error](https://support.cloudflare.com/hc/articles/115003011431#524error), ensuring that the connection remains active while the server processes the request.
Loading