File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed 
apps/dav/lib/CalDAV/WebcalCaching Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -34,14 +34,24 @@ public function queryWebcalFeed(array $subscription): ?string {
3434			return  null ;
3535		}
3636
37+ 		// ICS feeds hosted on O365 can return HTTP 500 when the UA string isn't satisfactory 
38+ 		// Ref https://github.com/nextcloud/calendar/issues/7234 
39+ 		$ uaString'Nextcloud Webcal Service ' ;
40+ 		if  (parse_url ($ urlPHP_URL_HOST ) === 'outlook.office365.com ' ) {
41+ 			// The required format/values here are not documented. 
42+ 			// Instead, this string based on research. 
43+ 			// Ref https://github.com/bitfireAT/icsx5/discussions/654#discussioncomment-14158051 
44+ 			$ uaString'Nextcloud (Linux) Chrome/66 ' ;
45+ 		}
46+ 
3747		$ allowLocalAccess$ this config ->getValueString ('dav ' , 'webcalAllowLocalAccess ' , 'no ' );
3848
3949		$ params
4050			'nextcloud '  => [
4151				'allow_local_address '  => $ allowLocalAccess'yes ' ,
4252			],
4353			RequestOptions::HEADERS  => [
44- 				'User-Agent '  => ' Nextcloud Webcal Service ' 
54+ 				'User-Agent '  => $ uaString 
4555				'Accept '  => 'text/calendar, application/calendar+json, application/calendar+xml ' ,
4656			],
4757		];
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments