Skip to content

Commit e5553fb

Browse files
InterLinked1Friendly Automation
authored and
Friendly Automation
committed
res_calendar_icalendar: Send user agent in request.
Microsoft recently began rejecting all requests for ICS calendars on Office 365 with 400 errors if the request doesn't contain a user agent. See: https://docs.microsoft.com/en-us/answers/questions/883904/34the-remote-server-returned-an-error-400-bad-requ.html Accordingly, we now send a user agent on requests for ICS files so that requests to Office 365 will work as they did before. ASTERISK-30106 Change-Id: Ie9dcaef12ae8adf37533c684499eb11005fac8f7
1 parent 0f0cc43 commit e5553fb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

res/res_calendar_icalendar.c

+1
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ static void *ical_load_calendar(void *void_data)
465465
pvt->session = ne_session_create(pvt->uri.scheme, pvt->uri.host, pvt->uri.port);
466466
ne_redirect_register(pvt->session);
467467
ne_set_server_auth(pvt->session, auth_credentials, pvt);
468+
ne_set_useragent(pvt->session, "Asterisk");
468469
if (!strcasecmp(pvt->uri.scheme, "https")) {
469470
ne_ssl_trust_default_ca(pvt->session);
470471
}

0 commit comments

Comments
 (0)