From: Naveen Albert Date: Mon, 20 Jun 2022 21:00:17 +0000 (+0000) Subject: res_calendar_icalendar: Send user agent in request. X-Git-Tag: 20.0.0-rc1~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5553fbd151e94be8e92f9d71b81b1681d5cb37d;p=thirdparty%2Fasterisk.git 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 --- diff --git a/res/res_calendar_icalendar.c b/res/res_calendar_icalendar.c index cab8cf628a..29be671d35 100644 --- a/res/res_calendar_icalendar.c +++ b/res/res_calendar_icalendar.c @@ -465,6 +465,7 @@ static void *ical_load_calendar(void *void_data) pvt->session = ne_session_create(pvt->uri.scheme, pvt->uri.host, pvt->uri.port); ne_redirect_register(pvt->session); ne_set_server_auth(pvt->session, auth_credentials, pvt); + ne_set_useragent(pvt->session, "Asterisk"); if (!strcasecmp(pvt->uri.scheme, "https")) { ne_ssl_trust_default_ca(pvt->session); }