From 661b3a98e4eb451e10128a5e37c242a1a4bd0ff6 Mon Sep 17 00:00:00 2001 From: Bryce Neal Date: Wed, 6 Oct 2021 09:37:02 -0700 Subject: [PATCH] Run code generation for 421 addition --- README.md | 1 + src/reason-phrases.ts | 8 +++++++- src/status-codes.ts | 8 +++++++- src/utils.ts | 6 ++++-- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 44c1cbf..5172d6c 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,7 @@ response | 418 | IM_A_TEAPOT | I'm a teapot | | 419 | INSUFFICIENT_SPACE_ON_RESOURCE | Insufficient Space on Resource | | 420 | METHOD_FAILURE | Method Failure | +| 421 | MISDIRECTED_REQUEST | Misdirected Request | | 422 | UNPROCESSABLE_ENTITY | Unprocessable Entity | | 423 | LOCKED | Locked | | 424 | FAILED_DEPENDENCY | Failed Dependency | diff --git a/src/reason-phrases.ts b/src/reason-phrases.ts index 665bce2..6e0ae40 100644 --- a/src/reason-phrases.ts +++ b/src/reason-phrases.ts @@ -335,5 +335,11 @@ export enum ReasonPhrases { * * 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. */ - USE_PROXY = "Use Proxy" + USE_PROXY = "Use Proxy", + /** + * Official Documentation @ https://datatracker.ietf.org/doc/html/rfc7540#section-9.1.2 + * + * 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. + */ + MISDIRECTED_REQUEST = "Misdirected Request" } diff --git a/src/status-codes.ts b/src/status-codes.ts index f170f6d..45922a5 100644 --- a/src/status-codes.ts +++ b/src/status-codes.ts @@ -335,5 +335,11 @@ export enum StatusCodes { * * 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. */ - USE_PROXY = 305 + USE_PROXY = 305, + /** + * Official Documentation @ https://datatracker.ietf.org/doc/html/rfc7540#section-9.1.2 + * + * 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. + */ + MISDIRECTED_REQUEST = 421 } diff --git a/src/utils.ts b/src/utils.ts index 9547581..f74ec23 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -54,7 +54,8 @@ export const statusCodeToReasonPhrase: Record = { "451": "Unavailable For Legal Reasons", "422": "Unprocessable Entity", "415": "Unsupported Media Type", - "305": "Use Proxy" + "305": "Use Proxy", + "421": "Misdirected Request" }; export const reasonPhraseToStatusCode: Record = { "Accepted": 202, @@ -111,5 +112,6 @@ export const reasonPhraseToStatusCode: Record = { "Unavailable For Legal Reasons": 451, "Unprocessable Entity": 422, "Unsupported Media Type": 415, - "Use Proxy": 305 + "Use Proxy": 305, + "Misdirected Request": 421 };