Skip to content

Commit

Permalink
Build 103 and 426
Browse files Browse the repository at this point in the history
  • Loading branch information
prettymuchbryce committed Sep 20, 2023
1 parent b04f738 commit 879e88c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ response
| 100 | CONTINUE | Continue |
| 101 | SWITCHING_PROTOCOLS | Switching Protocols |
| 102 | PROCESSING | Processing |
| 103 | EARLY_HINTS | Early Hints |
| 200 | OK | OK |
| 201 | CREATED | Created |
| 202 | ACCEPTED | Accepted |
Expand Down Expand Up @@ -87,6 +88,7 @@ response
| 422 | UNPROCESSABLE_ENTITY | Unprocessable Entity |
| 423 | LOCKED | Locked |
| 424 | FAILED_DEPENDENCY | Failed Dependency |
| 426 | UPGRADE_REQUIRED | Upgrade Required |
| 428 | PRECONDITION_REQUIRED | Precondition Required |
| 429 | TOO_MANY_REQUESTS | Too Many Requests |
| 431 | REQUEST_HEADER_FIELDS_TOO_LARGE | Request Header Fields Too Large |
Expand Down
12 changes: 12 additions & 0 deletions src/reason-phrases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,18 @@ export enum ReasonPhrases {
* This code indicates that the server has received and is processing the request, but no response is available yet.
*/
PROCESSING = "Processing",
/**
* Official Documentation @ https://www.rfc-editor.org/rfc/rfc8297#page-3
*
* This code indicates to the client that the server is likely to send a final response with the header fields included in the informational response.
*/
EARLY_HINTS = "Early Hints",
/**
* Official Documentation @ https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.15
*
* 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.
*/
UPGRADE_REQUIRED = "Upgrade Required",
/**
* Official Documentation @ https://tools.ietf.org/html/rfc7235#section-3.2
*
Expand Down
12 changes: 12 additions & 0 deletions src/status-codes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ export enum StatusCodes {
* This code indicates that the server has received and is processing the request, but no response is available yet.
*/
PROCESSING = 102,
/**
* Official Documentation @ https://www.rfc-editor.org/rfc/rfc8297#page-3
*
* This code indicates to the client that the server is likely to send a final response with the header fields included in the informational response.
*/
EARLY_HINTS = 103,
/**
* Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.1
*
Expand Down Expand Up @@ -270,6 +276,12 @@ export enum StatusCodes {
* The request failed due to failure of a previous request.
*/
FAILED_DEPENDENCY = 424,
/**
* Official Documentation @ https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.15
*
* 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.
*/
UPGRADE_REQUIRED = 426,
/**
* Official Documentation @ https://tools.ietf.org/html/rfc6585#section-3
*
Expand Down
4 changes: 4 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export const statusCodeToReasonPhrase: Record<string, string> = {
"412": "Precondition Failed",
"428": "Precondition Required",
"102": "Processing",
"103": "Early Hints",
"426": "Upgrade Required",
"407": "Proxy Authentication Required",
"431": "Request Header Fields Too Large",
"408": "Request Timeout",
Expand Down Expand Up @@ -96,6 +98,8 @@ export const reasonPhraseToStatusCode: Record<string, number> = {
"Precondition Failed": 412,
"Precondition Required": 428,
"Processing": 102,
"Early Hints": 103,
"Upgrade Required": 426,
"Proxy Authentication Required": 407,
"Request Header Fields Too Large": 431,
"Request Timeout": 408,
Expand Down

1 comment on commit 879e88c

@angelsupp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @prettymuchbryce , how to run npm run build in order to pass the CI ?

Please sign in to comment.