Skip to main content

hyperlane_plugin_problem_details/
const.rs

1/// RFC 9457 media type for Problem Details JSON responses.
2pub const PROBLEM_JSON_MEDIA_TYPE: &str = "application/problem+json; charset=utf-8";
3
4/// Media type prefix checked to avoid double-wrapping existing Problem Details responses.
5pub const PROBLEM_JSON_PREFIX: &str = "application/problem+json";
6
7/// Default RFC 9457 `type` URI (`"about:blank"`).
8pub const ABOUT_BLANK_TYPE: &str = "about:blank";
9
10/// Default fallback title for unrecognized error status codes.
11pub(crate) const DEFAULT_ERROR_TITLE: &str = "HTTP Error";
12
13/// Standard status code titles for RFC 9457 normalization.
14pub(crate) const TITLE_BAD_REQUEST: &str = "Bad Request";
15
16/// Standard title for HTTP 401.
17pub(crate) const TITLE_UNAUTHORIZED: &str = "Unauthorized";
18
19/// Standard title for HTTP 403.
20pub(crate) const TITLE_FORBIDDEN: &str = "Forbidden";
21
22/// Standard title for HTTP 404.
23pub(crate) const TITLE_NOT_FOUND: &str = "Not Found";
24
25/// Standard title for HTTP 405.
26pub(crate) const TITLE_METHOD_NOT_ALLOWED: &str = "Method Not Allowed";
27
28/// Standard title for HTTP 409.
29pub(crate) const TITLE_CONFLICT: &str = "Conflict";
30
31/// Standard title for HTTP 413.
32pub(crate) const TITLE_PAYLOAD_TOO_LARGE: &str = "Payload Too Large";
33
34/// Standard title for HTTP 422.
35pub(crate) const TITLE_UNPROCESSABLE_ENTITY: &str = "Unprocessable Entity";
36
37/// Standard title for HTTP 429.
38pub(crate) const TITLE_TOO_MANY_REQUESTS: &str = "Too Many Requests";
39
40/// Standard title for HTTP 500.
41pub(crate) const TITLE_INTERNAL_SERVER_ERROR: &str = "Internal Server Error";
42
43/// Standard title for HTTP 502.
44pub(crate) const TITLE_BAD_GATEWAY: &str = "Bad Gateway";
45
46/// Standard title for HTTP 503.
47pub(crate) const TITLE_SERVICE_UNAVAILABLE: &str = "Service Unavailable";
48
49/// Standard title for HTTP 504.
50pub(crate) const TITLE_GATEWAY_TIMEOUT: &str = "Gateway Timeout";
51
52/// Plain text media prefix eligible for automatic wrapping.
53pub(crate) const TEXT_PLAIN_PREFIX: &str = "text/plain";