]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_calendar_icalendar: Send user agent in request.
authorNaveen Albert <asterisk@phreaknet.org>
Mon, 20 Jun 2022 21:00:17 +0000 (21:00 +0000)
committerKevin Harwell <kharwell@digium.com>
Fri, 1 Jul 2022 15:09:08 +0000 (10:09 -0500)
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

res/res_calendar_icalendar.c

index cab8cf628ae077e360de84f7fdc7afe866b9e10b..29be671d359b40285bf1bdeccc94b6e0b0e8016d 100644 (file)
@@ -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);
        }