Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion apps/dav/lib/CalDAV/WebcalCaching/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,24 @@ public function queryWebcalFeed(array $subscription): ?string {
return null;
}

// ICS feeds hosted on O365 can return HTTP 500 when the UA string isn't satisfactory
// Ref https://github.com/nextcloud/calendar/issues/7234
$uaString = 'Nextcloud Webcal Service';
if (parse_url($url, PHP_URL_HOST) === 'outlook.office365.com') {
// The required format/values here are not documented.
// Instead, this string based on research.
// Ref https://github.com/bitfireAT/icsx5/discussions/654#discussioncomment-14158051
$uaString = 'Nextcloud (Linux) Chrome/66';
}

$allowLocalAccess = $this->config->getValueString('dav', 'webcalAllowLocalAccess', 'no');

$params = [
'nextcloud' => [
'allow_local_address' => $allowLocalAccess === 'yes',
],
RequestOptions::HEADERS => [
'User-Agent' => 'Nextcloud Webcal Service',
'User-Agent' => $uaString,
'Accept' => 'text/calendar, application/calendar+json, application/calendar+xml',
],
];
Expand Down
Loading