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 @@ -32,14 +32,24 @@ public function queryWebcalFeed(array $subscription): ?string {
3232 return null ;
3333 }
3434
35+ // ICS feeds hosted on O365 can return HTTP 500 when the UA string isn't satisfactory
36+ // Ref https://github.com/nextcloud/calendar/issues/7234
37+ $ uaString = 'Nextcloud Webcal Service ' ;
38+ if (parse_url ($ url , PHP_URL_HOST ) === 'outlook.office365.com ' ) {
39+ // The required format/values here are not documented.
40+ // Instead, this string based on research.
41+ // Ref https://github.com/bitfireAT/icsx5/discussions/654#discussioncomment-14158051
42+ $ uaString = 'Nextcloud (Linux) Chrome/66 ' ;
43+ }
44+
3545 $ allowLocalAccess = $ this ->config ->getValueString ('dav ' , 'webcalAllowLocalAccess ' , 'no ' );
3646
3747 $ params = [
3848 'nextcloud ' => [
3949 'allow_local_address ' => $ allowLocalAccess === 'yes ' ,
4050 ],
4151 RequestOptions::HEADERS => [
42- 'User-Agent ' => ' Nextcloud Webcal Service ' ,
52+ 'User-Agent ' => $ uaString ,
4353 'Accept ' => 'text/calendar, application/calendar+json, application/calendar+xml ' ,
4454 ],
4555 ];
You can’t perform that action at this time.
0 commit comments