Bug 1793757 - CalICSProvider should request ics data, not xml. r=lasana
When requesting text/xml, servers would and should should return HTTP 406. Differential Revision: https://phabricator.services.mozilla.com/D158821 --HG-- extra : rebase_source : d9f54e266d737331781480474edd99043e570ac1 extra : amend_source : aaa9a1e2850ca26a7fcff355d0fe9c10504888d0
This commit is contained in:
Родитель
cbb42e9da9
Коммит
5a297af0a5
|
@ -231,6 +231,7 @@ class CalDavRequestBase {
|
|||
copyHeader("Recipient");
|
||||
copyHeader("If-None-Match");
|
||||
copyHeader("If-Match");
|
||||
copyHeader("Accept");
|
||||
|
||||
aNewChannel.requestMethod = oldHttpChannel.requestMethod;
|
||||
this.session.prepareRedirect(aOldChannel, aNewChannel).then(() => {
|
||||
|
|
|
@ -274,7 +274,9 @@ class ICSDetector {
|
|||
* @return {Promise<calICalendar[] | null>} An array of calendars or null.
|
||||
*/
|
||||
async _attemptMethod(method, location) {
|
||||
let request = new CalDavGenericRequest(this.session, null, method, location);
|
||||
let request = new CalDavGenericRequest(this.session, null, method, location, {
|
||||
Accept: "text/calendar, application/ics, text/plain;q=0.9",
|
||||
});
|
||||
|
||||
// `request.commit()` can throw; errors should be caught by calling functions.
|
||||
let response = await request.commit();
|
||||
|
|
Загрузка…
Ссылка в новой задаче