File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 2323 T : DecompressTrait + std:: fmt:: Debug ,
2424{
2525 pub fn new ( message : & ' a mut T , buf : & ' a mut BytesMut ) -> Self {
26- let body = message. get_body ( ) . into_bytes ( ) . unwrap ( ) ;
26+ let body = match message. get_body ( ) {
27+ Body :: Raw ( data) => data,
28+ Body :: Chunked ( chunks) => {
29+ message. set_body ( Body :: Chunked ( chunks) ) ;
30+ buf. split ( )
31+ }
32+ } ;
2733 let extra_body = message. get_extra_body ( ) ;
2834 let body_headers = message. body_headers_as_mut ( ) . take ( ) ;
2935 Self {
4551 }
4652
4753 pub fn chunked_to_raw ( & mut self ) {
48- if let Body :: Chunked ( _) = self . message . get_body ( ) {
49- chunked_to_raw ( self . message , & mut self . buf ) ;
50- }
54+ chunked_to_raw ( self . message , & mut self . buf ) ;
55+ self . body = self . message . get_body ( ) . into_bytes ( ) . unwrap ( ) ;
5156 }
5257
5358 pub fn transfer_encoding_is_some ( & self ) -> bool {
You can’t perform that action at this time.
0 commit comments