pub struct SecurityBodyLayer { /* private fields */ }Expand description
Tower layer that scans URI, headers, and the request body.
The body is read exactly once (up to body_limit
bytes) and passed through to the inner service, so handlers still receive
the full payload. Use this instead of SecurityLayer when request
bodies must also be checked for SQLi/XSS payloads.
Implementations§
Source§impl SecurityBodyLayer
impl SecurityBodyLayer
pub fn new() -> Self
Sourcepub fn body_limit(self, limit: usize) -> Self
pub fn body_limit(self, limit: usize) -> Self
Maximum body size (in bytes) that will be buffered and scanned. Larger bodies are rejected with a 413 (Payload Too Large) rather than buffered.
Trait Implementations§
Source§impl Clone for SecurityBodyLayer
impl Clone for SecurityBodyLayer
Source§impl Default for SecurityBodyLayer
impl Default for SecurityBodyLayer
Auto Trait Implementations§
impl !RefUnwindSafe for SecurityBodyLayer
impl !UnwindSafe for SecurityBodyLayer
impl Freeze for SecurityBodyLayer
impl Send for SecurityBodyLayer
impl Sync for SecurityBodyLayer
impl Unpin for SecurityBodyLayer
impl UnsafeUnpin for SecurityBodyLayer
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