Skip to content

Commit 661b3a9

Browse files
Run code generation for 421 addition
1 parent 68dd311 commit 661b3a9

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ response
8383
| 418 | IM_A_TEAPOT | I'm a teapot |
8484
| 419 | INSUFFICIENT_SPACE_ON_RESOURCE | Insufficient Space on Resource |
8585
| 420 | METHOD_FAILURE | Method Failure |
86+
| 421 | MISDIRECTED_REQUEST | Misdirected Request |
8687
| 422 | UNPROCESSABLE_ENTITY | Unprocessable Entity |
8788
| 423 | LOCKED | Locked |
8889
| 424 | FAILED_DEPENDENCY | Failed Dependency |

src/reason-phrases.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,5 +335,11 @@ export enum ReasonPhrases {
335335
*
336336
* Was defined in a previous version of the HTTP specification to indicate that a requested response must be accessed by a proxy. It has been deprecated due to security concerns regarding in-band configuration of a proxy.
337337
*/
338-
USE_PROXY = "Use Proxy"
338+
USE_PROXY = "Use Proxy",
339+
/**
340+
* Official Documentation @ https://datatracker.ietf.org/doc/html/rfc7540#section-9.1.2
341+
*
342+
* Defined in the specification of HTTP/2 to indicate that a server is not able to produce a response for the combination of scheme and authority that are included in the request URI.
343+
*/
344+
MISDIRECTED_REQUEST = "Misdirected Request"
339345
}

src/status-codes.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,5 +335,11 @@ export enum StatusCodes {
335335
*
336336
* Was defined in a previous version of the HTTP specification to indicate that a requested response must be accessed by a proxy. It has been deprecated due to security concerns regarding in-band configuration of a proxy.
337337
*/
338-
USE_PROXY = 305
338+
USE_PROXY = 305,
339+
/**
340+
* Official Documentation @ https://datatracker.ietf.org/doc/html/rfc7540#section-9.1.2
341+
*
342+
* Defined in the specification of HTTP/2 to indicate that a server is not able to produce a response for the combination of scheme and authority that are included in the request URI.
343+
*/
344+
MISDIRECTED_REQUEST = 421
339345
}

src/utils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ export const statusCodeToReasonPhrase: Record<string, string> = {
5454
"451": "Unavailable For Legal Reasons",
5555
"422": "Unprocessable Entity",
5656
"415": "Unsupported Media Type",
57-
"305": "Use Proxy"
57+
"305": "Use Proxy",
58+
"421": "Misdirected Request"
5859
};
5960
export const reasonPhraseToStatusCode: Record<string, number> = {
6061
"Accepted": 202,
@@ -111,5 +112,6 @@ export const reasonPhraseToStatusCode: Record<string, number> = {
111112
"Unavailable For Legal Reasons": 451,
112113
"Unprocessable Entity": 422,
113114
"Unsupported Media Type": 415,
114-
"Use Proxy": 305
115+
"Use Proxy": 305,
116+
"Misdirected Request": 421
115117
};

0 commit comments

Comments
 (0)