pub enum SecurityError {
AttackBlocked(String),
BodyTooLarge,
Inner(Box<dyn Error + Send + Sync>),
}Variants§
AttackBlocked(String)
BodyTooLarge
请求体超过 body_limit 上限(读体阶段即拒绝,不进入扫描)。
Inner(Box<dyn Error + Send + Sync>)
Implementations§
Source§impl SecurityError
impl SecurityError
pub fn to_http_status(&self) -> StatusCode
Trait Implementations§
Source§impl Debug for SecurityError
impl Debug for SecurityError
Source§impl Display for SecurityError
impl Display for SecurityError
Source§impl Error for SecurityError
impl Error for SecurityError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl IntoResponse for SecurityError
拦截结果映射为 HTTP 响应:攻击拦截为 403,请求体超限为 413,内部
错误为 500。内部错误的原始信息只进日志,响应体保持通用文案,避免
把内部错误细节(文件路径、SQL、堆栈)泄露给客户端。
impl IntoResponse for SecurityError
拦截结果映射为 HTTP 响应:攻击拦截为 403,请求体超限为 413,内部 错误为 500。内部错误的原始信息只进日志,响应体保持通用文案,避免 把内部错误细节(文件路径、SQL、堆栈)泄露给客户端。
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Create a response.
Auto Trait Implementations§
impl !RefUnwindSafe for SecurityError
impl !UnwindSafe for SecurityError
impl Freeze for SecurityError
impl Send for SecurityError
impl Sync for SecurityError
impl Unpin for SecurityError
impl UnsafeUnpin for SecurityError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more