File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -121,18 +121,15 @@ pub async fn extract_request_body(
121121/// errors (e.g. an oversized payload exceeding `DefaultBodyLimit`), the body
122122/// is replaced with empty bytes so that processing can continue with headers
123123/// only.
124- pub async fn extract_request_body_or_empty (
125- request : Request ,
126- ) -> ( http:: request:: Parts , Bytes ) {
124+ pub async fn extract_request_body_or_empty ( request : Request ) -> ( http:: request:: Parts , Bytes ) {
127125 let ( parts, body) = request. into_parts ( ) ;
128- let bytes =
129- match Bytes :: from_request ( Request :: from_parts ( parts. clone ( ) , body) , & ( ) ) . await {
130- Ok ( b) => b,
131- Err ( e) => {
132- warn ! ( "Failed to buffer request body: {e}. Processing with empty payload." ) ;
133- Bytes :: new ( )
134- }
135- } ;
126+ let bytes = match Bytes :: from_request ( Request :: from_parts ( parts. clone ( ) , body) , & ( ) ) . await {
127+ Ok ( b) => b,
128+ Err ( e) => {
129+ warn ! ( "Failed to buffer request body: {e}. Processing with empty payload." ) ;
130+ Bytes :: new ( )
131+ }
132+ } ;
136133 ( parts, bytes)
137134}
138135
You can’t perform that action at this time.
0 commit comments