[Asterisk-code-review] res_calendar_icalendar: Send user agent in request. (asterisk[19])

Kevin Harwell asteriskteam at digium.com
Fri Jul 1 10:09:10 CDT 2022


Kevin Harwell has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/18700 )

Change subject: res_calendar_icalendar: Send user agent in request.
......................................................................

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
---
M res/res_calendar_icalendar.c
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved; Approved for Submit



diff --git a/res/res_calendar_icalendar.c b/res/res_calendar_icalendar.c
index cab8cf6..29be671 100644
--- a/res/res_calendar_icalendar.c
+++ b/res/res_calendar_icalendar.c
@@ -465,6 +465,7 @@
 	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);
 	}

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/18700
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 19
Gerrit-Change-Id: Ie9dcaef12ae8adf37533c684499eb11005fac8f7
Gerrit-Change-Number: 18700
Gerrit-PatchSet: 2
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220701/0528e51c/attachment-0001.html>


More information about the asterisk-code-review mailing list