File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed 
lib/private/Collaboration/Reference Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,22 @@ private function fetchReference(Reference $reference): void {
104104		}
105105
106106		$ client$ this clientService ->newClient ();
107+ 		try  {
108+ 			$ headResponse$ clienthead ($ referencegetId (), [ 'timeout '  => 10  ]);
109+ 		} catch  (\Exception   $ e
110+ 			$ this logger ->debug ('Failed to perform HEAD request to get target metadata ' , ['exception '  => $ e
111+ 			return ;
112+ 		}
113+ 		$ linkContentLength$ headResponsegetHeader ('Content-Length ' );
114+ 		if  (is_numeric ($ linkContentLengthint ) $ linkContentLength5  * 1024  * 1024 ) {
115+ 			$ this logger ->debug ('Skip resolving links pointing to content length > 5 MB ' );
116+ 			return ;
117+ 		}
118+ 		$ linkContentType$ headResponsegetHeader ('Content-Type ' );
119+ 		if  ($ linkContentType'text/html ' ) {
120+ 			$ this logger ->debug ('Skip resolving links pointing to content type that is not "text/html" ' );
121+ 			return ;
122+ 		}
107123		try  {
108124			$ response$ clientget ($ referencegetId (), [ 'timeout '  => 10  ]);
109125		} catch  (\Exception   $ e
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments