@@ -458,7 +458,7 @@ impl FetchRequest {
458458
459459/// Builder for [`FetchRequest`], created via [`FetchRequest::builder`].
460460///
461- /// All settings are optional; `build()` produces a buffered, non- decoding request
461+ /// All settings are optional; `build()` produces a buffered, decoding request
462462/// with [`Priority::Normal`] unless configured otherwise.
463463pub struct FetchRequestBuilder {
464464 reference : RequestReference ,
@@ -488,7 +488,7 @@ impl FetchRequestBuilder {
488488 initiator : Initiator :: default ( ) ,
489489 kind : ResourceKind :: default ( ) ,
490490 streaming : false ,
491- auto_decode : false ,
491+ auto_decode : true ,
492492 max_bytes : None ,
493493 body : None ,
494494 }
@@ -530,7 +530,10 @@ impl FetchRequestBuilder {
530530 self
531531 }
532532
533- /// Sets whether to transparently decode compressed responses (default: false)
533+ /// Sets whether to transparently decode compressed responses (default: true).
534+ ///
535+ /// With decoding on, [`with_max_bytes`](Self::with_max_bytes) caps the decompressed
536+ /// size; set `false` to cap bytes as they arrive on the wire.
534537 pub fn with_auto_decode ( mut self , auto_decode : bool ) -> Self {
535538 self . auto_decode = auto_decode;
536539 self
@@ -679,6 +682,13 @@ mod tests {
679682 assert_eq ! ( buffered. as_bytes( ) . map( |b| b. len( ) ) , Some ( 3 ) ) ;
680683 }
681684
685+ #[ test]
686+ fn builder_decodes_by_default ( ) {
687+ let fr =
688+ FetchRequest :: builder ( Method :: GET , Url :: parse ( "https://example.org" ) . unwrap ( ) ) . build ( ) ;
689+ assert ! ( fr. auto_decode) ;
690+ }
691+
682692 #[ test]
683693 fn fetch_request_generate_get_and_headers ( ) {
684694 let mut fr = FetchRequest :: builder (
0 commit comments