Skip to main content

rama_http/layer/
mod.rs

1//! Http [`Layer`]s provided by Rama.
2//!
3//! A [`Layer`], as defined in [`rama_core::Service`],
4//! is a middleware that can modify the request and/or response of a [`Service`]s.
5//! It is also capable of branching between two or more [`Service`]s.
6//!
7//! Examples:
8//! - [`auth`]: A layer that can be used to authenticate requests, branching
9//!   in case the request is not authenticated (read: rejected).
10//! - [`cors`]: A layer that can be used to add CORS headers to the response.
11//!
12//! Most layers are implemented as a [`Service`], and then wrapped in a [`Layer`].
13//! This is done to allow the layer to be used as a service, and to allow it to be
14//! composed with other layers.
15//!
16//! [`Layer`]: rama_core::Layer
17//! [`Service`]: rama_core::Service
18
19pub mod auth;
20pub mod body_limit;
21pub mod catch_panic;
22pub mod classify;
23pub mod collect_body;
24pub mod cors;
25pub mod csrf;
26pub mod dns;
27pub mod dpi_proxy_credential;
28pub mod error_handling;
29pub mod follow_redirect;
30pub mod forwarded;
31pub mod har;
32pub mod header_config;
33pub mod header_from_str_config;
34pub mod header_option_value;
35pub mod into_response;
36pub mod map_request_body;
37pub mod map_response_body;
38pub mod match_redirect;
39pub mod normalize_path;
40pub mod propagate_headers;
41pub mod proxy_auth;
42pub mod remove_header;
43pub mod request_id;
44pub mod required_header;
45pub mod retry;
46pub mod rewrite_uri;
47pub mod sensitive_headers;
48pub mod set_header;
49pub mod set_status;
50pub mod timeout;
51pub mod trace;
52pub mod traffic_writer;
53pub mod upgrade;
54pub mod validate_request;
55pub mod version_adapter;
56
57#[cfg(feature = "html")]
58#[cfg_attr(docsrs, doc(cfg(feature = "html")))]
59pub mod html_rewrite;
60
61pub mod json_capture;
62pub mod json_rewrite;
63
64#[cfg(feature = "opentelemetry")]
65#[cfg_attr(docsrs, doc(cfg(feature = "opentelemetry")))]
66pub mod opentelemetry;
67
68pub(crate) mod util;
69
70#[cfg(feature = "compression")]
71#[cfg_attr(docsrs, doc(cfg(feature = "compression")))]
72pub mod compression;
73#[cfg(feature = "compression")]
74#[cfg_attr(docsrs, doc(cfg(feature = "compression")))]
75pub mod decompression;