fix(core): update
This commit is contained in:
@ -13,7 +13,7 @@ export class Status100 extends HttpStatus {
|
||||
To have a server check the request's headers,
|
||||
a client must send Expect: 100-continue as a header in its initial request and receive
|
||||
a 100 Continue status code in response before sending the body.
|
||||
The response 417 Expectation Failed indicates the request should not be continued.`
|
||||
The response 417 Expectation Failed indicates the request should not be continued.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -24,7 +24,7 @@ export class Status101 extends HttpStatus {
|
||||
super({
|
||||
code: 101,
|
||||
text: 'Switching Protocols',
|
||||
description: `The requester has asked the server to switch protocols and the server has agreed to do so.`
|
||||
description: `The requester has asked the server to switch protocols and the server has agreed to do so.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -39,7 +39,7 @@ export class Status102 extends HttpStatus {
|
||||
requiring a long time to complete the request.
|
||||
This code indicates that the server has received and is processing the request,
|
||||
but no response is available yet.[6]
|
||||
This prevents the client from timing out and assuming the request was lost.`
|
||||
This prevents the client from timing out and assuming the request was lost.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ export class Status200 extends HttpStatus {
|
||||
description: `Standard response for successful HTTP requests.
|
||||
The actual response will depend on the request method used.
|
||||
In a GET request, the response will contain an entity corresponding to the requested resource.
|
||||
In a POST request, the response will contain an entity describing or containing the result of the action.`
|
||||
In a POST request, the response will contain an entity describing or containing the result of the action.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -20,7 +20,7 @@ export class Status201 extends HttpStatus {
|
||||
super({
|
||||
code: 201,
|
||||
text: 'Created',
|
||||
description: `The request has been fulfilled, resulting in the creation of a new resource.`
|
||||
description: `The request has been fulfilled, resulting in the creation of a new resource.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -33,7 +33,7 @@ export class Status202 extends HttpStatus {
|
||||
code: 202,
|
||||
text: 'Accepted',
|
||||
description: `The request has been accepted for processing, but the processing has not been completed.
|
||||
The request might or might not be eventually acted upon, and may be disallowed when processing occurs.`
|
||||
The request might or might not be eventually acted upon, and may be disallowed when processing occurs.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -46,7 +46,7 @@ export class Status203 extends HttpStatus {
|
||||
code: 203,
|
||||
text: 'Non-Authoritative Information',
|
||||
description: `The server is a transforming proxy (e.g. a Web accelerator)
|
||||
that received a 200 OK from its origin, but is returning a modified version of the origin's response.`
|
||||
that received a 200 OK from its origin, but is returning a modified version of the origin's response.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -58,7 +58,7 @@ export class Status204 extends HttpStatus {
|
||||
super({
|
||||
code: 204,
|
||||
text: 'Non-Authoritative Information',
|
||||
description: `The server successfully processed the request and is not returning any content.`
|
||||
description: `The server successfully processed the request and is not returning any content.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -71,7 +71,7 @@ export class Status205 extends HttpStatus {
|
||||
code: 205,
|
||||
text: 'Reset Content',
|
||||
description: `The server successfully processed the request, but is not returning any content.
|
||||
Unlike a 204 response, this response requires that the requester reset the document view.`
|
||||
Unlike a 204 response, this response requires that the requester reset the document view.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -86,7 +86,7 @@ export class Status206 extends HttpStatus {
|
||||
description: `The server is delivering only part of the resource (byte serving)
|
||||
due to a range header sent by the client.
|
||||
The range header is used by HTTP clients to enable resuming of interrupted downloads,
|
||||
or split a download into multiple simultaneous streams.`
|
||||
or split a download into multiple simultaneous streams.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -100,7 +100,7 @@ export class Status207 extends HttpStatus {
|
||||
text: 'Multi-Status',
|
||||
description: `The message body that follows is an XML message
|
||||
and can contain a number of separate response codes,
|
||||
depending on how many sub-requests were made.`
|
||||
depending on how many sub-requests were made.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -114,7 +114,7 @@ export class Status208 extends HttpStatus {
|
||||
text: 'Already Reported',
|
||||
description: `The members of a DAV binding have already been enumerated
|
||||
in a preceding part of the (multistatus) response,
|
||||
and are not being included again.`
|
||||
and are not being included again.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -128,7 +128,7 @@ export class Status226 extends HttpStatus {
|
||||
text: 'IM Used',
|
||||
description: `The server has fulfilled a request for the resource,
|
||||
and the response is a representation of the result of one or more instance-manipulations
|
||||
applied to the current instance.`
|
||||
applied to the current instance.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ export class Status300 extends HttpStatus {
|
||||
description: `Indicates multiple options for the resource from which the client may choose
|
||||
(via agent-driven content negotiation).
|
||||
For example, this code could be used to present multiple video format options,
|
||||
to list files with different filename extensions, or to suggest word-sense disambiguation.`
|
||||
to list files with different filename extensions, or to suggest word-sense disambiguation.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -20,7 +20,7 @@ export class Status301 extends HttpStatus {
|
||||
super({
|
||||
code: 301,
|
||||
text: 'Moved Permanently',
|
||||
description: `This and all future requests should be directed to the given URI.`
|
||||
description: `This and all future requests should be directed to the given URI.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -37,7 +37,7 @@ export class Status302 extends HttpStatus {
|
||||
(the original describing phrase was "Moved Temporarily"),
|
||||
[20] but popular browsers implemented 302 with the functionality of a 303 See Other.
|
||||
Therefore, HTTP/1.1 added status codes 303 and 307 to distinguish between the two behaviours.[21]
|
||||
However, some Web applications and frameworks use the 302 status code as if it were the 303.`
|
||||
However, some Web applications and frameworks use the 302 status code as if it were the 303.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -52,7 +52,7 @@ export class Status303 extends HttpStatus {
|
||||
description: `The response to the request can be found under another URI using a GET method.
|
||||
When received in response to a POST (or PUT/DELETE),
|
||||
the client should presume that the server has received the data and should issue a redirect
|
||||
with a separate GET message.`
|
||||
with a separate GET message.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -67,7 +67,7 @@ export class Status304 extends HttpStatus {
|
||||
description: `Indicates that the resource has not been modified
|
||||
since the version specified by the request headers If-Modified-Since or If-None-Match.
|
||||
In such case, there is no need to retransmit the resource since the client
|
||||
still has a previously-downloaded copy.`
|
||||
still has a previously-downloaded copy.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -82,7 +82,7 @@ export class Status305 extends HttpStatus {
|
||||
description: `The requested resource is available only through a proxy,
|
||||
the address for which is provided in the response. Many HTTP clients (such as Mozilla[25]
|
||||
and Internet Explorer) do not correctly handle responses with this status code,
|
||||
primarily for security reasons.`
|
||||
primarily for security reasons.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -94,7 +94,7 @@ export class Status306 extends HttpStatus {
|
||||
super({
|
||||
code: 306,
|
||||
text: 'Switch Proxy',
|
||||
description: `No longer used. Originally meant "Subsequent requests should use the specified proxy."`
|
||||
description: `No longer used. Originally meant "Subsequent requests should use the specified proxy."`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -110,7 +110,7 @@ export class Status307 extends HttpStatus {
|
||||
however, future requests should still use the original URI.
|
||||
In contrast to how 302 was historically implemented,
|
||||
the request method is not allowed to be changed when reissuing the original request.
|
||||
For example, a POST request should be repeated using another POST request.`
|
||||
For example, a POST request should be repeated using another POST request.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -124,7 +124,7 @@ export class Status308 extends HttpStatus {
|
||||
text: 'Permanent Redirect',
|
||||
description: `The request and all future requests should be repeated using another URI.
|
||||
307 and 308 parallel the behaviors of 302 and 301, but do not allow the HTTP method to change.
|
||||
So, for example, submitting a form to a permanently redirected resource may continue smoothly.`
|
||||
So, for example, submitting a form to a permanently redirected resource may continue smoothly.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ export class Status400 extends HttpStatus {
|
||||
super({
|
||||
code: 400,
|
||||
text: 'Bad Request',
|
||||
description: `The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, too large size, invalid request message framing, or deceptive request routing).`
|
||||
description: `The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, too large size, invalid request message framing, or deceptive request routing).`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -18,7 +18,7 @@ export class Status401 extends HttpStatus {
|
||||
code: 401,
|
||||
text: 'Unauthorized',
|
||||
description: `Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet been provided. The response must include a WWW-Authenticate header field containing a challenge applicable to the requested resource. See Basic access authentication and Digest access authentication.[32] 401 semantically means "unauthenticated",[33] i.e. the user does not have the necessary credentials.
|
||||
Note: Some sites issue HTTP 401 when an IP address is banned from the website (usually the website domain) and that specific address is refused permission to access a website.`
|
||||
Note: Some sites issue HTTP 401 when an IP address is banned from the website (usually the website domain) and that specific address is refused permission to access a website.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -30,7 +30,7 @@ export class Status402 extends HttpStatus {
|
||||
super({
|
||||
code: 402,
|
||||
text: 'Payment Required',
|
||||
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`
|
||||
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -42,7 +42,7 @@ export class Status403 extends HttpStatus {
|
||||
super({
|
||||
code: 403,
|
||||
text: 'Forbidden',
|
||||
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`
|
||||
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -54,7 +54,7 @@ export class Status404 extends HttpStatus {
|
||||
super({
|
||||
code: 404,
|
||||
text: 'Not Found',
|
||||
description: `The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible.`
|
||||
description: `The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -66,7 +66,7 @@ export class Status429 extends HttpStatus {
|
||||
super({
|
||||
code: 429,
|
||||
text: 'Too Many Requests',
|
||||
description: `The user has sent too many requests in a given amount of time. Intended for use with rate-limiting schemes.`
|
||||
description: `The user has sent too many requests in a given amount of time. Intended for use with rate-limiting schemes.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ export class Status500 extends HttpStatus {
|
||||
code: 500,
|
||||
text: 'Internal Server Error',
|
||||
description:
|
||||
'A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.'
|
||||
'A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.',
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -18,7 +18,7 @@ export class Status501 extends HttpStatus {
|
||||
super({
|
||||
code: 501,
|
||||
text: 'Bad Request',
|
||||
description: `The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, too large size, invalid request message framing, or deceptive request routing).`
|
||||
description: `The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, too large size, invalid request message framing, or deceptive request routing).`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -30,7 +30,7 @@ export class Status502 extends HttpStatus {
|
||||
super({
|
||||
code: 502,
|
||||
text: 'Payment Required',
|
||||
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`
|
||||
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -42,7 +42,7 @@ export class Status503 extends HttpStatus {
|
||||
super({
|
||||
code: 503,
|
||||
text: 'Forbidden',
|
||||
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`
|
||||
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -55,7 +55,7 @@ export class Status504 extends HttpStatus {
|
||||
code: 504,
|
||||
text: 'Gateway Time-out',
|
||||
description: `The server was acting as a gateway or proxy
|
||||
and did not receive a timely response from the upstream server.`
|
||||
and did not receive a timely response from the upstream server.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -67,7 +67,7 @@ export class Status505 extends HttpStatus {
|
||||
super({
|
||||
code: 505,
|
||||
text: 'HTTP Version Not Supported',
|
||||
description: `The server does not support the HTTP protocol version used in the request.`
|
||||
description: `The server does not support the HTTP protocol version used in the request.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -79,7 +79,7 @@ export class Status506 extends HttpStatus {
|
||||
super({
|
||||
code: 506,
|
||||
text: 'Variant Also Negotiates',
|
||||
description: `Transparent content negotiation for the request results in a circular reference.`
|
||||
description: `Transparent content negotiation for the request results in a circular reference.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -92,7 +92,7 @@ export class Status507 extends HttpStatus {
|
||||
super({
|
||||
code: 507,
|
||||
text: 'Insufficient Storage',
|
||||
description: `The server is unable to store the representation needed to complete the request.`
|
||||
description: `The server is unable to store the representation needed to complete the request.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -105,7 +105,7 @@ export class Status508 extends HttpStatus {
|
||||
super({
|
||||
code: 508,
|
||||
text: 'Loop Detected',
|
||||
description: `The server detected an infinite loop while processing the request`
|
||||
description: `The server detected an infinite loop while processing the request`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -117,7 +117,7 @@ export class Status510 extends HttpStatus {
|
||||
super({
|
||||
code: 510,
|
||||
text: 'Loop Detected',
|
||||
description: `The server detected an infinite loop while processing the request`
|
||||
description: `The server detected an infinite loop while processing the request`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -130,7 +130,7 @@ export class Status511 extends HttpStatus {
|
||||
text: 'Network Authentication Required',
|
||||
description: `The client needs to authenticate to gain network access.
|
||||
Intended for use by intercepting proxies used to control access to the network
|
||||
(e.g., "captive portals" used to require agreement to Terms of Service before granting full Internet access via a Wi-Fi hotspot)`
|
||||
(e.g., "captive portals" used to require agreement to Terms of Service before granting full Internet access via a Wi-Fi hotspot)`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
export type TStatusGroup = 'clientError' | 'serverError';
|
||||
|
||||
export class HttpStatus {
|
||||
public static statusMap: {[key:string]: any} = {};
|
||||
public static addStatus (statusStringArg: string, statusArg: any) {
|
||||
public static statusMap: { [key: string]: any } = {};
|
||||
public static addStatus(statusStringArg: string, statusArg: any) {
|
||||
HttpStatus.statusMap[statusStringArg] = statusArg;
|
||||
}
|
||||
public static getHttpStatusByString (codeStringArg: string): HttpStatus {
|
||||
const statusInstance = new (HttpStatus.statusMap[codeStringArg])();
|
||||
public static getHttpStatusByString(codeStringArg: string): HttpStatus {
|
||||
const statusInstance = new HttpStatus.statusMap[codeStringArg]();
|
||||
return statusInstance;
|
||||
}
|
||||
public code: number;
|
||||
|
Reference in New Issue
Block a user