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

Added HTTP Status Code 208 - Already Reported #75

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ response
| 205 | RESET_CONTENT | Reset Content |
| 206 | PARTIAL_CONTENT | Partial Content |
| 207 | MULTI_STATUS | Multi-Status |
| 208 | ALREADY_REPORTED | Already Reported |
| 300 | MULTIPLE_CHOICES | Multiple Choices |
| 301 | MOVED_PERMANENTLY | Moved Permanently |
| 302 | MOVED_TEMPORARILY | Moved Temporarily |
Expand Down
9 changes: 9 additions & 0 deletions codes.json
Original file line number Diff line number Diff line change
Expand Up @@ -495,5 +495,14 @@
"doc": "Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.6",
"description": "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."
}
},
{
"code": 208,
"phrase": "Already Reported",
"constant": "ALREADY_REPORTED",
"comment": {
"doc": "Official Documentation @ https://datatracker.ietf.org/doc/html/rfc5842#section-7.1",
"description": "The 208 (Already Reported) status code can be used inside a DAV: propstat response element to avoid enumerating the internal members of multiple bindings to the same collection repeatedly."
}
}
]
8 changes: 7 additions & 1 deletion src/reason-phrases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/rfc5842#section-7.1
*
* The 208 (Already Reported) status code can be used inside a DAV: propstat response element to avoid enumerating the internal members of multiple bindings to the same collection repeatedly.
*/
ALREADY_REPORTED = "Already Reported"
}
8 changes: 7 additions & 1 deletion src/status-codes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/rfc5842#section-7.1
*
* The 208 (Already Reported) status code can be used inside a DAV: propstat response element to avoid enumerating the internal members of multiple bindings to the same collection repeatedly.
*/
ALREADY_REPORTED = 208
}
6 changes: 4 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ export const statusCodeToReasonPhrase: Record<string, string> = {
"451": "Unavailable For Legal Reasons",
"422": "Unprocessable Entity",
"415": "Unsupported Media Type",
"305": "Use Proxy"
"305": "Use Proxy",
"208": "Already Reported"
};
export const reasonPhraseToStatusCode: Record<string, number> = {
"Accepted": 202,
Expand Down Expand Up @@ -111,5 +112,6 @@ export const reasonPhraseToStatusCode: Record<string, number> = {
"Unavailable For Legal Reasons": 451,
"Unprocessable Entity": 422,
"Unsupported Media Type": 415,
"Use Proxy": 305
"Use Proxy": 305,
"Already Reported": 208
};