File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -434,18 +434,24 @@ impl Media {
434434 }
435435 }
436436
437+ let request_config = self
438+ . client
439+ . request_config ( )
440+ // Downloading a file should have no timeout as we don't know the network connectivity
441+ // available for the user or the file size
442+ . timeout ( None ) ;
443+
437444 // Use the authenticated endpoints when the server supports Matrix 1.11 or the
438445 // authenticated media stable feature.
439446 let ( use_auth, request_config) =
440447 if self . client . server_versions ( ) . await ?. contains ( & MatrixVersion :: V1_11 ) {
441- ( true , None )
448+ ( true , request_config )
442449 } else if self . client . unstable_features ( ) . await ?. contains ( & FeatureFlag :: Msc3916Stable ) {
443450 // We need to force the use of the stable endpoint with the Matrix version
444451 // because Ruma does not handle stable features.
445- let request_config = self . client . request_config ( ) ;
446- ( true , Some ( request_config. force_matrix_version ( MatrixVersion :: V1_11 ) ) )
452+ ( true , request_config. force_matrix_version ( MatrixVersion :: V1_11 ) )
447453 } else {
448- ( false , None )
454+ ( false , request_config )
449455 } ;
450456
451457 let content: Vec < u8 > = match & request. source {
You can’t perform that action at this time.
0 commit comments